Welcome to Tech A Byte Solutions. Your Trusted Web Companion with Total Web Solution!!

×

Welcome to Tech A Byte Solutions. Your Trusted Web Companion with Total Web Solution!!

MySQL Trouble shooting

Try checking for Typos by printing out the query that is getting sent to MySQL Server from your code.

For example if you MySQL Code looks like:

$query = ‘SELECT * FROM t4 WHERE f1 IN(‘;
for ($i = 1; $i < 101; $i ++)
$query .= “‘row$i,”;
$query = rtrim($query, ‘,’);
$query .= ‘)’;
$result = mysql_query($query);

Try adding echo $query; into the code like this:

$query = ‘SELECT * FROM t4 WHERE f1 IN(‘;
for ($i = 1; $i < 101; $i ++)
$query .= “‘row$i,”;
$query = rtrim($query, ‘,’);
$query .= ‘)’;
echo $query; 

//$result = mysql_query($query);

This shold print the query that is actually getting sent to MySQL Server and you may find errors in the query.

Back to Top
error: Alert: All Contents of TechAByte Solutions are protected !!