954,597 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

php Update query Problem

Hi,
Page 1

<td width="68"><a href="directory_update.php?updateid=<?php echo $row_Directory['Sno']; ?>"><img src="images/btns/delete.png" width="36" height="36" border="0" /></a></td>


Page 2

mysql_select_db($database_Connection, $Connection);
$query_Directory_update = "update directory set Sno=<?php $Directory_update['Sno']; ?>where Sno='$_GET[updateid]'";
$Directory_update = mysql_query($query_Directory_update, $Connection) or die(mysql_error());
$row_Directory_update = mysql_fetch_assoc($Directory_update);
$totalRows_Directory_update = mysql_num_rows($Directory_update);


Error
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in C:\wamp\www\prophp\directory_update.php on line 84

khushhappy
Light Poster
39 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 


$query_Directory_update = "update directory set Sno=<?php $Directory_update['Sno']; ?>where Sno='$_GET[updateid]'";

try to modified the above code into this:

$query_Directory_update = mysql_query("update directory set directory.Sno='$Directory_update[Sno]' where Sno='".$_GET[updateid]."'");

I think you don't have any PHP error with that query, but I'm not so sure if the query successfully update the record, since I don't know what is the exact variable from your database and PHP code itself.

lyrico
Junior Poster in Training
94 posts since Dec 2010
Reputation Points: 33
Solved Threads: 15
 

Thanks,
Solved

khushhappy
Light Poster
39 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: