you should probably research a little first, before posting, but it's all good.
open the SQL persistant connection:
mysql_pconnect("", "database_login","database_password")
- if the sql is not on your server, read about mysql_pconnect and mysql_connect
select the database
mysql_select_db("databaseName");
make query data safe by adding slashes:
$queryData1 = addslashes($queryData1);
$queryData2 = addslashes($queryData2);
make query:
$query = "INSERT INTO your_table (blah1, blah2) VALUES (\"$queryData1\", \"$queryData2\")";
get result:
$result = mysql_query($query);
if you were fetching data (ie, using SELECT instead of INSERT), you can receive either an array, or object (recommended).
with the array, you do this:
$record = mysql_fetch_array($result);
then, access: $record[0] as the first column, $record[1] as the second, etc...
or to use the object,
$record = mysql_fetch_object($result);
then you can access the column values easier:
$record->mycolumn_1_name
$record->my_column_2_name
etc.
also, in the case of multiple rows being returned, the mysql_query will receive all rows, so you make that one call, then loop through the $result var.
while($record = mysql_fetch_object($result)){
//do somethin with $record->mycolumn_1_name
}
okay, there's your crash course. please lemme know if it helps out. in the future, you might wanna spend a little more time searching through the forum and manual, cause there's a wealth of information there. save the posts for the hard questions, k?
good luck
🙂
blake caldwell