when i first tested it i had
if (!$db)
{
echo 'Error: Could not connect to database. Please try again later.';
exit;
}
after it, so i'm pretty sure it worked unless i did that bit wrong
Name:
Anonymous2007-08-01 20:50 ID:O2B6vtO9
Ok, and does mysql_select_db return TRUE or FALSE?
Name:
Anonymous2007-08-01 20:54 ID:SoiA2EAj
false
Name:
Anonymous2007-08-01 21:01 ID:O2B6vtO9
Ok, then use mysql_error to see why.
Name:
Anonymous2007-08-01 21:13 ID:SoiA2EAj
it's blank if i've used it right
$sd= mysql_select_db("nuclear_books",$db);
echo mysql_error();
if ($sd = "false")
{
echo "selecting database failed <br>";
}
It displays selecting database failed but mysql_error isn't returning anything
Name:
Anonymous2007-08-01 21:20 ID:O2B6vtO9
>>13
That's because mysql_select_db is not failing. Instead of the incorrect if($sd = "false"), try if(!$sd).
Name:
Anonymous2007-08-01 21:22 ID:O2B6vtO9
Also, read this to see why $sd = "false" is wrong:
Did you read the pages I posted in >>15? Here is where you fail it:
- using the = assignment operator instead of the == comparison operator in ($sd = "false"). This will return the value "false" to the if statement.
- using the string "false" instead of the boolean constant FALSE. In fact, "false" evaluates to TRUE.
Name:
Anonymous2007-08-01 21:39 ID:O2B6vtO9
It's probably worth pointing out that if you have:
if (expr) {
lolwhat();
}
then lolwhat() is only executed if expr evaluates to boolean TRUE.
And instead of testing the expression $sd == FALSE you can use the negation operator ! and test !$sd because it turns TRUE into FALSE and FALSE into TRUE.
Name:
Anonymous2007-08-01 21:40 ID:Kp8tClKP
DON'T HELP HIM
he is complete failure
Name:
Anonymous2007-08-01 21:42 ID:SoiA2EAj
thanks i've been trying to work this out for 2 days, you're a life saver
Name:
Anonymous2007-08-01 21:44 ID:SoiA2EAj
yes i am a failure, which is why i'm asking for help so i can try to defail myself
and it didn't upload properly so i didn't see those when i posted 16 sorry
Name:
Anonymous2007-08-01 21:46 ID:x0DU4fmF
>>22
Defail yourself? Ain't gonna happen. BE AN HERO NOW.
Name:
Anonymous2007-08-01 21:49 ID:SoiA2EAj
meh i said try to, i can live with being a failure, i'm still happy
Name:
Anonymous2007-08-01 21:49 ID:Kp8tClKP
defail is the most amusing verb i've encountered all day
Posting small amounts of of text you Editorian an essential essential Island to to all the other car models And then The blame the language language for our x86 processors In In order to to carry out out on rotating some trippy shit.