cachopa
02-25-2008, 08:27 AM
Hello!
I'm developing a website in PHP and MySQL database.
I have an inline query in my page and one of the columns is an array.
I need this query to select data dependending on the value that the variable has.
Like this:
$arrayA = array("News","Events");
$news = $arrayA[0];
$events = $arrayA[1];
(...)
vsprintf("SELECT * FROM table WHERE var='%s'",$arrayA);
(...)
I need to select the data that it's in the row of the table 'table', depending if var=News or/and var=Events...
This code is just giving the same id, wich is the id of the row "News"...
Can anyone help me?
I'm developing a website in PHP and MySQL database.
I have an inline query in my page and one of the columns is an array.
I need this query to select data dependending on the value that the variable has.
Like this:
$arrayA = array("News","Events");
$news = $arrayA[0];
$events = $arrayA[1];
(...)
vsprintf("SELECT * FROM table WHERE var='%s'",$arrayA);
(...)
I need to select the data that it's in the row of the table 'table', depending if var=News or/and var=Events...
This code is just giving the same id, wich is the id of the row "News"...
Can anyone help me?