Jump to content

Get error in mysql update line..


PhpxZ

Recommended Posts

The line:

 

if (mysql_query('INSERT INTO `chars` (`accid`,`charname`,`sex`,`age`,`pgmg`,`dmrktt`,`history`,`carcrashrp`,`carscrash`) VALUES ('. $_SESSION['Logged'] .',\''. $_POST['charname'] .',\''.$_POST['sex'] .',\''. $_POST['age'] .',\''. $_POST['pgmg'] .'\',\''. $_POST['dmrktt']. '\',\''. $_POST['history'] .'\',\''. $_POST['carcrashrp'] .'\',\''. $_POST['carscrash'] .'\')', $con))

 

 

I have the rows in the mysql..

 

but i still get error..

the error is:

 

Error! You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near

Link to comment
https://forums.phpfreaks.com/topic/206336-get-error-in-mysql-update-line/
Share on other sites

<?php
$sql = "INSERT INTO `chars` (`accid`,`charname`,`sex`,`age`,`pgmg`,`dmrkt`,`history`,`carcrashrp`,`carscrach`)
	VALUES('".$_SESSION['Logged']."','".$_POST['charname']."','".$_POST['sex']."','".$_POST['age']."','".$_POST['pgmg']."','".$_POST['dmrktt']."','".$_POST['history']."','".$_POST['carcrashrp']."','".$_POST['carscrash']."')";
$res = mysql_query($sql) or die(mysql_error());
?>

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.