Forum Moderators: coopster
<?php
if( is_numeric( $_GET['from_message_id'] ) ){ //we're inserting from phone messages
//connect to db
mysql_select_db($database_message, $message);
$results = mysql_query( "SELECT (message_from) FROM messages WHERE id={$_GET['from_message_id']}" ); // get the message info we want to insert from $id=$_GET['id']; id={$_GET['from_message_id']}
$row = mysql_fetch_assoc($results);
mysql_query( "INSERT INTO clients (contact_name) VALUES (".GetSQLValueString($row['message_from'],"text").")" ); //run the insert with the fields you want from the result of the last query, just like is done everywhere else in these files
$_GET['id'] = mysql_query( "SELECT LAST_INSERT_ID()" ); //get the new row id and set it so client_edit knows what to edit
}
?>
Thanks a bunch in advance.
$q = "SELECT (message_from) FROM messages WHERE id='" . $_GET['from_message_id'] . "'";
echo $q;
$results = mysql_query($q);
>>You have an error in your SQL syntax near 'id #9' at line 1
...and line 1 of this particular snippet of code looks just fine to me. I'm willing to bet it is your user-defined function that is causing the issue,
GetSQLValueString. Have a look at that function.