i'm building this little function,
what i need is this query to print me values. Which means, i have this array named $checked1 which i need to print each of it inside a query.
My code up to now is:
$result = mysql_query("SELECT $checked FROM hostess");
while($row = mysql_fetch_array($result))
{foreach( $checked1 as $key => $value){
echo "<td>" . $row['$value'] . "</td>";
}
But it's not working.
Can you tell me what's wrong?
Thanks..
$checkedand$checked1? And what do you mean by "not working"? What's happening when you try to run the code?mysql_*functions in new code. They were removed from PHP 7.0.0 in 2015. Instead, use prepared statements via PDO or MySQLi. See Why shouldn't I use mysql_* functions in PHP? for more information.