General Community > Scripting Help

mysql_fetch_array question...

<< < (2/2)

Iridium:
I believe I've spotted it!

For the first query, (the SELECT) you assign the result to $request, however, you then assign the result of the second query (the DELETE) to $request also. (Since DELETEs don't return any results, you get the invalid resource error).

Just remove the $request = from the second query.

Joshua Dickerson:
That would do it.

[Unknown]:
Man, I feel useless.

Yeah, storing the results of DELETE's etc... is stupid :P.  I don't know why everyone does it so much...

-[Unknown]

Aquilo:
When I had a hard time with the script I went to my trusty learning code!

$request = mysql_query("DELETE FROM {$db_prefix}log_online WHERE identity='$userID'") or database_error(__FILE__, __LINE__);

A while back I asked my self if it was alright to use the same $variable more then once for querys and YaBBSE has it like that so I thought it was right! :o

cool I learned something very usefully today!!! :D :D

[Unknown]:
Let me assure you SMF does NOT have it... at all. (or at least, not that I can run across...)

-[Unknown]

Navigation

[0] Message Index

[*] Previous page

Go to full version