I already have a MYSQL database.
I already have ( I hope) a PHP code for making connection with that database.
What I still need (and I hope thats ALL I need) is a way to insert all variables directed towards that PHP page (from a flash file) into the actull database .
If I understand correctly what I need is called a mysql_query.
IsINSERT` - the query that I need ?
I would very much apperciate if a wiser person could add the needed code to the code attached at the bottom.
Also would I like to make sure another thing : all this code is to be inserted in the HEAD or the BODY of the PHP page ?
Thanks heartily and in advance .
option a:
<?php
/ database.inc - Login to database /
$dbh=mysql_connect ("127.0.0.1", "username", "password");
if (!$dbh) {
echo mysql_error();
exit;
} else {
$db_select = mysql_select_db("database");
if (!$db_select) {
echo mysql_error();
exit;
} else {
}
}
?>
and also option b :
<?
@mysql_connect('localhost', 'username', 'password') ? mysql_select_db('database') : die(mysql_error());
?>