Jump to content

[SOLVED] Update issue


blui

Recommended Posts

Hi all,

 

I am trying to create a table that contains links to image files, so user A selects which image they want to use this week and can then come back and change the image link the following week, my code is below.

 

I am therefore trying to get the code to UPDATE the value with in field 'links1' where PRIMARYID = 1

But I keep recieving the following error message, where my update line is, can anyone help?

 

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in f:\program files\easyphp1-7\www\php\postinfo2.php on line 12

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<?

require_once('connectionlocal.php');

?>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Untitled Document</title>

</head>

<body>

<?PHP

 

$sql = "UPDATE `cmscontent ` SET `links1` = '$_POST['imagelist']' WHERE `PRIMARY ID ` =1 ";

 

$queryResult = mysql_query($sql)

    or die("An error has happened: " . mysql_error());

?>

</body>

</html>

Link to comment
https://forums.phpfreaks.com/topic/43932-solved-update-issue/
Share on other sites

try:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?
require_once('connectionlocal.php');
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<?PHP

$sql = "UPDATE `cmscontent ` SET `links1` = '".$_POST['imagelist']."' WHERE `PRIMARY ID ` ='1 '";

$queryResult = mysql_query($sql)
     or die("An error has happened: " . mysql_error());
?>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/43932-solved-update-issue/#findComment-213318
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.