Jump to content

[SOLVED] help needed with update


kev wood

Recommended Posts

i have created an content management system for a flash web site which was all working fine.  i have now been asked to add an image upload function to the site to accompany the content already being added.

 

i am trying to upload the article as it was before using forms and sending all the variables over to a processing page which tells the user if it was added or not.  the user is then redirected to this page.  once back on this page the user has the option to upload an image for that article.

 

i have got the image upload working fine but i cannot get it update the table and put the image in the row for the article.

 

here is the code i have for updating the table

 

$run=mysql_query('select max(id) from internal');
$lastid = mysql_fetch_row($run);
$lastid=$lastid[0];
$sql="UPDATE internal SET image= $consname2  WHERE id= $lastid";
$query = mysql_query($sql);

 

the first section of the code is returning the the highest number in the id column but the table is not getting updated.  any help with this would be great.

Link to comment
https://forums.phpfreaks.com/topic/132582-solved-help-needed-with-update/
Share on other sites

i marked the topic solved as i had help from another part of this site to get the answer (in the php section) as these sections are closely linked i assumed that the majority of people who come on this section will also pay a visit to the php section therefore will be able to see the answer to the question there.

i marked the topic solved as i had help from another part of this site to get the answer (in the php section) as these sections are closely linked i assumed that the majority of people who come on this section will also pay a visit to the php section therefore will be able to see the answer to the question there.

If that's the case, then at least post the URL of the related post/thread!  I've never visited the php section.

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.