Reply to Re: php - inserting info into a database

Your name:

Reply:


Posted by bobzimuta on 03/23/06 22:04

Extract the query into a string (i.e. $query = "..."), and replace
mysql_query() with
the following:

if( !mysql_query( $query, $connection ) )
{
exit( mysql_error( $connection ) . "<br>Query: <br><pre>" . $query .
"</pre>" );
}

You can wrap all your query calls in a function, as it enables basic
debugging any time a query might fail
function my_query( $query, $connection, $DEBUG = 0 )
{
$query_worked = mysql_query....
if( !$query_worked && $DEBUG )
{
// do the exit and output here, or just output and return
$query_worked
}
else
{
return $query_worked;
}
}

}

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация