Jump to content

Archived

This topic is now archived and is closed to further replies.

zirgs

check successfull query

Recommended Posts

Hi.
I have very simple question about mysql ...
can someone tell me function that checks if query was successfull?
or just use somth like that?
[code]
if (!$query)
{
echo "Not good ;(";
}
)
[/code]

Share this post


Link to post
Share on other sites
if($record['name'] >0) {

echo" entry there";

}else {

echo " no entry";
}

Share this post


Link to post
Share on other sites
See the "MySQL Data Retrieval" section in the FAQ page:

http://www.phpfreaks.com/forums/index.php/topic,31047.msg153359.html#msg153359

Share this post


Link to post
Share on other sites
Ideally, you [i]always[/i] want to check the status of your queries. If you're doing this a lot, rather than repeating the code, extend the mysqli class. There is some introductory material [url=http://www.zend.com/php5/articles/php5-mysqli2.php#Heading5]here[/url].

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.