localhost1 Posted September 28, 2007 Share Posted September 28, 2007 hi everybody i have a problem in the sql query. my query is this $sSqlQuery="select user_reserve_time_start,user_reserve_time_end,user_reserve_date from voyance_user WHERE user_id= '".$u_id."' and user_reservetype='Domicile Reservation'"; $row=mysql_query($sSqlQuery); while($rest=mysql_fetch_array($row)) { $start_time=$rest['reserve_time_start']; $end_time=$rest['reserve_time_end']; $reserve_date=$rest['reserve_date']; echo $reserve_date; } where is the error in the query. Quote Link to comment https://forums.phpfreaks.com/topic/71006-solved-supplied-argument-not-valid/ Share on other sites More sharing options...
trq Posted September 28, 2007 Share Posted September 28, 2007 What error are you getting? Quote Link to comment https://forums.phpfreaks.com/topic/71006-solved-supplied-argument-not-valid/#findComment-357030 Share on other sites More sharing options...
dingus Posted September 28, 2007 Share Posted September 28, 2007 just a question this part here WHERE user_id= '".$u_id."' im just thinking that it may be looking for a user id in the database of "4" for example why are you opening quotes then escaping them only asking because user ids are usually auto numbers an can throw that kind of error when asking for a text field (something containing quotes"") Quote Link to comment https://forums.phpfreaks.com/topic/71006-solved-supplied-argument-not-valid/#findComment-357035 Share on other sites More sharing options...
localhost1 Posted September 28, 2007 Author Share Posted September 28, 2007 i m getting the following errror Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\wamp\www\directory\filename.php on line 176 Quote Link to comment https://forums.phpfreaks.com/topic/71006-solved-supplied-argument-not-valid/#findComment-357040 Share on other sites More sharing options...
dingus Posted September 28, 2007 Share Posted September 28, 2007 well i would say this line here is falling over $row=mysql_query($sSqlQuery); because $row is being not containing the data you want it to try changeing WHERE user_id= '".$u_id."' to WHERE user_id= $u_id and see if that helps Quote Link to comment https://forums.phpfreaks.com/topic/71006-solved-supplied-argument-not-valid/#findComment-357044 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.