Jump to content

mysql question


Cyto

Recommended Posts

How are we supposed to know? What is the value of $link? Did you verify it has the value you expect? Does the variable contain a value that is consistent with the database field (i.e. are you trying to store text into a numeric field)? Although, that last problem would likely create an error rather than inserting an empty field.

 

Also, there is no need to include the 'id' in the insert query if it is an auto-increment field. Try the following

 

$link = $m[1];
$ssql = "INSERT INTO `site` (`link`) VALUES ('$link');";
$result = mysql_query($ssql);

//Debugging code
echo "The value of the link: '{$link}'<br>\n";
echo "Insert Query: {$ssql}<br>\n";
if(!$result) { echo "Query failed: " . mysql_error();

Link to comment
https://forums.phpfreaks.com/topic/252134-mysql-question/#findComment-1292663
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.