Re: PHP MySQL insert

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You need to escape the data, so....

$data1 = mysql_real_escape_string($data1,$rLink);
$data2 = mysql_real_escape_string($data2,$rLink);


Jon wrote:

Please help with an insert problem.

Sometimes $data1 could have a comma and that messes up the insert.  how do I
get around that?

$query = "insert into testtable6 (indx, col1, col2) values (NULL, '$data1',
'$data2')";
mysql_db_query("testdb", $query);


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux