Jump to content

UPDATE WHERE code no longer works on new server; help


mhedges

Recommended Posts

Hello,

 

I have recently moved hosting servers to Directnic.com. I moved the MySQL tables and webpages over, but found that for some reason, while the pages that pull data work fine, my update code no longer works. You can see it at www.vinodelsol.com/supply/index.php . You'll see the data is pulled fine, but when you click on "Edit" on the right, the data is not loaded in the update.php page (as it is using the exact same code on my old server)... I am really frustrated... here is the code for the update.php:

 

  if (@$first == "no")
  {

        $query = "UPDATE supply SET name='$name',last='$last',four='$four',five='$five',six='$six',seven='$seven',eight='$eight',other='$other' WHERE id='$id'";
        $result = mysql_query($query)
             or die ("Couldn't execute query. 1");
        echo "Thank you! Information entered. <a href=index.php>View Supply Sheet</a><br>";
        exit();

  }
  else
  {
    $query = "SELECT * FROM supply WHERE id='$id'";
    $result = mysql_query($query)
         or die ("Couldn't execute query. 2");
    $row = mysql_fetch_array($result);
    extract($row);
  }

  
  echo "<br><p align='center'>
       <font size='+1'><b>Please check the container below and correct if necessary.</b></font>
       <hr>
       <form action='update.php?first=no' method='post'>
   <input type='hidden' name='id' value='$id' >
        <div align='center'>
        <table width='50%' border='0' cellspacing='0' cellpadding='2'>
        <tr>
      
        <td align='center'><u>Wine</td>
        <td align='center'><u>2004</td>
<td align='center'><u>2005</td>
<td align='center'><u>2006</td>
<td align='center'><u>2007</td>
<td align='center'><u>2008</td>
<td align='center'><u>Notes</td>
<td align='center'><u>Last Updated</td>
</tr>
        <tr><td align='center'><input type=text name='name' size='20' value='$name' /></td>
        <td align='center'><input type=text name='four' size='8' value='$four' /></td>
           <td align='center'><input type='text' name='five' size='8' maxlength='20' value='$five' > </td>
           <td align='center'><input type='text' name='six' size='8' maxlength='20' value='$six' > </td>
           <td align='center'><input type='text' name='seven' size='8' maxlength='20' value='$seven' > </td>
           <td align='center'><input type='text' name='eight' size='8' maxlength='20' value='$eight' > </td> 
           <td align='center'><input type='text' name='other' size='40' maxlength='75' value='$other' > </td>        
           <td align='center'><input type='text' name='last' size='8' maxlength='20' value='$last' > </td>     
        </tr>
        <tr><td></td><td align='center'>
           <br><input type='submit' value='Update Supply'></td>
        </tr>
        </table>
       </form>";
?>

 

 

I have update privileges.

 

Any help is greatly appreciated,

thanks

Matt

is this ever true?

 

if (@$first == "no")

 

echo and see.

 

expansion: without seeing the code before the bit you posted, my assumption is that you expect $first == "no", but that $first isn't defined, probably because on your previous host you had register_globals turned on (bad) and on your new host register_globals is no longer turned on (good).

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.