Posts: 427
Name: Stuart
Location: Glasgow, Scotland
|
SELECT statement:
PHP Code:
$result = mysql_query("SELECT * FROM table_name WHERE condition='$condition'");
That statement will pull all the data from the database table with the conditions specified.
PHP Code:
$result_array = mysql_fetch_array($result);
This will put the row in an array and you can access each field individually
(e.g. $name = $result_array['name']
To INSERT the data back into the table use this code:
PHP Code:
$query = "INSERT INTO table_name( field1, field2, field3)
values( '$field1, '$field2, '$field3')";
mysql_query($query, $link)
or die("Couldn't add data to \"table_name\" table: "
.mysql_error() );
mysql_close ($link);
I dont know about the JOIN statement but im sure someone here will...
Hope this helps
Stoot
|