Jump to content


Photo

check successfull query


  • Please log in to reply
4 replies to this topic

#1 zirgs

zirgs
  • Members
  • PipPip
  • Member
  • 25 posts

Posted 17 July 2006 - 07:00 PM

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?
if (!$query)
{
echo "Not good ;(";
}
)


#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 17 July 2006 - 07:04 PM

if($record['name'] >0) {

echo" entry there";

}else {

echo " no entry";
}
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 toplay

toplay
  • Staff Alumni
  • Advanced Member
  • 973 posts

Posted 17 July 2006 - 07:06 PM

See the "MySQL Data Retrieval" section in the FAQ page:

http://www.phpfreaks....html#msg153359

#4 zirgs

zirgs
  • Members
  • PipPip
  • Member
  • 25 posts

Posted 17 July 2006 - 08:03 PM

thank you  ;)

#5 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 17 July 2006 - 08:09 PM

Ideally, you always 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 here.
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users