Link to home
Start Free TrialLog in
Avatar of helpchrisplz
helpchrisplz

asked on

update query

hi am unsure whats wrong with this UPDATE query thanks for helping :


CREATE TABLE IF NOT EXISTS `images` (
  `pictureId` int(4) NOT NULL auto_increment,
  `memberId` int(11) default NULL,
  `imgLarge` varchar(255) default NULL,
  `imgSmall` varchar(255) default NULL,
  PRIMARY KEY  (`pictureId`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

$sqlUpdate = "UPDATE `images` SET `imgLarge` = '".$file."', `imgSmall` = '".$save."' WHERE `pictureId` = '".$pictureId."'";

thank you for helping
ASKER CERTIFIED SOLUTION
Avatar of Beverley Portlock
Beverley Portlock
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gDueck
gDueck

The tail of your query ends with (cut-and-paste) '".$pictureId."'" That's double-quote single-quote .$pictureid. double-quote single-quote double-quote. Your quotes need to be modified.

This is a debugging issue. If the query looks right but fails to execute, you might try to print the query on a console as it is being passed to MySQL to ensure the what you typed is what you wanted (wytiwyw).
.. perhaps try to remove the ~ sign :
$sqlUpdate = "UPDATE images SET imgLarge='".$file."', imgSmall='".$save."' WHERE pictureId='".$pictureId."'";

Open in new window

Avatar of helpchrisplz

ASKER

mysql_query was missing thx