I got table names from may schema into array. Now I want to use this array to make a scan through these tables and get latest date to make future update. Problem what I have now is I don't know how to use this array to make a SELECT query. To be honest Iv tried everything what i know like different quot dots mysql versus mysqli (".$table.") do some work I have output what i want but stil errors are echo. Below is the error what Im getting for
Warning: mysql_error() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\Stock_Project\UI\updater.php on line 36
Error occur probably because I try parse array int a string...??
Once when table is defined manually this piece of code is working. Does anybody knows solution how to Use array values to query database?? Appreciate for any help
$schema Array ( [0] => aaoi [1] => adbe [2] => blfs [3] => comm [4] => cste [5] => f [6] => input_control [7] => nasdaq [8] => nflx [9] => ntgr [10] => omab [11] => ubnt [12] => user [13] => yahoo [14] => yhoo [15] => zn )
foreach ($schema as $table) {
$sql=mysql_query("SELECT * FROM '$table' ORDER by date DESC LIMIT 1");
if(!$sql)
{
echo mysql_error($sql);
}
}
while($row= mysql_fetch_assoc($sql))
{
$data[] = $row['date'];
}