Closed Thread Icon

Topic awaiting preservation: array problem (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12063" title="Pages that link to Topic awaiting preservation: array problem (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: array problem <span class="small">(Page 1 of 1)</span>\

 
Air
Nervous Wreck (II) Inmate

From: Sweden
Insane since: Nov 2001

posted posted 02-24-2002 18:45

Hi again !

problem:
I want to have different '$query' s depending on
the '$pass' value

if the '$pass' value is
"password1" then I want "$query = 'blaha blaha' " ..

--

but if the '$pass' value is
" in_array($pass, $userpws) " I want " $query = 'blehe blehe' " ..

--
I keep getting the error message that "the supplied argument is not a valid MySQL result resource"
when $pass value is "in_array..."

what to do ? =)


butcher
Paranoid (IV) Inmate

From: New Jersey, USA
Insane since: Oct 2000

posted posted 02-24-2002 20:19

Are you sure $userpws is an actual array?

-Butcher-

Air
Nervous Wreck (II) Inmate

From: Sweden
Insane since: Nov 2001

posted posted 02-24-2002 23:04

well .. this is how it looks..

$userpws = array("value1","value2","value3","value4");

thats right aint it ?

butcher
Paranoid (IV) Inmate

From: New Jersey, USA
Insane since: Oct 2000

posted posted 02-25-2002 02:00

The in_array function should have nothing to do with the MySQL result resource unless you are trying to use it in a query or something.

Also, in_array() is case sensitive so you need to keep that in mind in your comparisons.

-Butcher-

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 02-25-2002 07:36

Air, since you're getting MySQL error, I would suggest you to check SQL query. You should check if it returned anything before you pass MySQL result to fetch_array function. If you can't get it to work, post your whole script so that we can analyze it...


« BackwardsOnwards »

Show Forum Drop Down Menu