Jump to content

so close yet so far!


kev wood

Recommended Posts

i thought i had this working but alas i was wrong.  the variable $table is getting posted to the page via a hidden form input, and i know this because it lets me echo it out.

 

the problem lies in this code somewhere.

 

$run=mysql_query ('SELECT max(id) from $table') or die(mysql_error());
$lastid = mysql_fetch_row($run)or die(mysql_error());
$lastid=$lastid[0]or die(mysql_error());
$sql="UPDATE $table SET image= '$consname2'  WHERE id= '$lastid'"or die(mysql_error());
$query = mysql_query($sql)or die(mysql_error());

 

when i select the image to up load i get the error

 

Table 'xxxxxxxxxdb.$table' doesn't exist

 

why will it let me echo the variable but not let me use it inside the query.

Link to comment
https://forums.phpfreaks.com/topic/133513-so-close-yet-so-far/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.