How can i insert into a MySQL DB table through multiple .php file? is there a connection id?
Mar 10th, 2006 08:18
Praveen Kumar Kukkapalli, Dawit Abraham, Cinley Rodick, David Greenberg, Mohamed Farouk, http://www.generalforums.com , http://www.generalforums.com/yellow/
Yes, you can use the connection_id.
$conn_id = mysql_connect("HOST", "USER", PASS);
then while executing query
$result = mysql_query("SQL QUERY", $conn_id);
Then you can work with multiple databases in the same script. You just
need to establish different onnections and use that connectionID for
executing the queries on tables in different databases.
Yes, the mysql_connect() function returns a "resource," which acts as
handle to the current connection. Like other variables, this can be
passed to another page using POST or GET variables.
You may want to use the mysql_pconnect() function for a persistent
connection. Refer http://www.php.net/mysql_pconnect for more