954,174 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

php variable in mysql query

Hi everybody
I am very new to PHP and MYSQL
How can I implement :

$q=$_GET["q"]; 
$CMY=$get["CMY"];
...
$query=("INSERT INTO the_array($CMY, model) 
                          VALUES('$q','dddd')");


$q and $CMY are results I get from AJAX, and I think the only way to save the results
is using the DB.

kukie
Newbie Poster
3 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 
$Name=$_GET["name"];
$Email=$_GET["email"];
...
$sql="INSERT INTO tablename(db_field1, db_field2)
                              VALUES('$Name','$Email');

mysql_qyery($sql)


This is the most simplest way to insert data into database.

kamran_FrizCon
Light Poster
33 posts since Jul 2009
Reputation Points: 10
Solved Threads: 4
 

Thank you Kamran.

kukie
Newbie Poster
3 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You