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
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.

Link to comment
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.

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.