The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
Please vote in the Forum Structure Poll. Polling will close at 2PM EST on January 21, 2025.
Taco Bell does win the franchise war according to the tome of knowledge that is Demolition Man. However, I've watched Demolition Man more then a few times and never once did I see WoW. In conclusion Taco Bell has more lasting power then WoW.
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\bnb\confirmation.php on line 35
on this
$query = "SELECT visID, visRoomNum, UNIX_TIMESTAMP(visStartDate), UNIX_TIMESTAMP(visEndDate), visConfirmed FROM tblvisit WHERE visConfirmed = '0' AND visRoomNum=$roomNum";
$result = mysql_db_query('dbname', $query, $dbLink) or die(mysql_error());
while ($row = mysql_fetch_array($result))
i can't figure it out. because everything seems right when i look at the syntax and the table names and col names.
$roomNum is a variable, so you need to have it outside the quotes of the string so that it reads whats in the variable instead of simply the variable name
$query = "SELECT visID, visRoomNum, UNIX_TIMESTAMP(visStartDate), UNIX_TIMESTAMP(visEndDate), visConfirmed FROM tblvisit WHERE visConfirmed = '0' AND visRoomNum='" . $roomNum . "'";
that way you put whatever is in $roomnum into the query string and also encapsulate it in single quotes.
if you decide you need double quotes, which is what I think I did in my project, you'll need to use \"". $roomNum . "\""
okay i just got home i'm going to make these changes, also i should mention something funny about my error. everything i wanted the query to do was accomplished but i still received the error. i have not used sql in a long time so i dont know if that's common
i was getting the error because i had overwritten the variable named $query. i had used it twice for two different queries. weird. but its fixed now. thanks for the help
Posts
so "...AND visRoomNum = '$roomNum'";
$roomNum is a variable, so you need to have it outside the quotes of the string so that it reads whats in the variable instead of simply the variable name
$query = "SELECT visID, visRoomNum, UNIX_TIMESTAMP(visStartDate), UNIX_TIMESTAMP(visEndDate), visConfirmed FROM tblvisit WHERE visConfirmed = '0' AND visRoomNum='" . $roomNum . "'";
that way you put whatever is in $roomnum into the query string and also encapsulate it in single quotes.
if you decide you need double quotes, which is what I think I did in my project, you'll need to use \"". $roomNum . "\""
I believe that should help
You'll also need to throw a mysql_select_db("dbname") in there before the query.
Check the api at php.net, you can search by function name.