Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Databasing
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 07-19-2002, 02:12 PM
  #1
Ganon of Evil
Veteran (Level 7)
 
Join Date: Jul 2002
Location: behind you..
Posts: 63
iTrader: (0)
Ganon of Evil is on a distinguished road
PHP/MySQL Problem

Ive recently switched to a new host and am having a problem. I want it to do a very simple thing:

PHP Code:
$temp_result mysql_query("SELECT * FROM table WHERE id=1") or die(mysql_error()); 
The problem is that if i enter an invalid ID, it doesnt return false like it should, which is annoying because I have to do this instead:

PHP Code:
$temp_result mysql_query("SELECT * FROM table WHERE id=1");
$thisrow mysql_fetch_array($temp_result);

if (
$thisrow[0]==NULL){
die ();

On the old host, if it was an invalid ID, it would return FALSE. On this one, if its an invalid ID, it returns TRUE with everything NULL. Any suggestions?
Ganon of Evil is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 07-21-2002, 11:32 AM
  #2
scoutt
Mister Admin to you
 
scoutt's Avatar
 
Join Date: Jul 2001
Posts: 30,867
iTrader: (0)
scoutt is a jewel in the roughscoutt is a jewel in the roughscoutt is a jewel in the roughscoutt is a jewel in the rough
for my experiences the select will never return false. you have to check for it all the time. so it seems that the server you where on last was setup that way.
__________________
Have a Script or Snippet you want to share?

WWW Standards: HTML 4.01, CSS2.1, CSS3, XHTML 1.0
PHP Standards: PHP Standards
scoutt is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart



 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 01:48 AM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.