One MySQL Database & Multiple Table

Viewed 3398

How to connect to a certain table in MySQL database?

I have tried :

mysql_select_db("baybeestore",$connection);

but it gives me an error :-

"Error : Table 'baybeestore.form' doesn't exist"

But I've created a table named as order. Are there any PHP codes to connect to my table order in the same database that have multiple databases?

Is it wise enough to create multiple database & one table for one website or multiple table with one database?

FULL CODE :

$connection = mysql_connect("localhost","user","1234");
    if(!$connection)
    {
        die('Failed to connect to MySQL :' . mysql_error());
    }
    mysql_select_db("baybeestore",$connection)
    $sql = "INSERT INTO
    form(name, address, email, handphone, item, payment)

    VALUES
    ('$strname', '$straddress', '$stremail', '$strhandphone', '$stritem', '$strpayment')";

    if(!mysql_query($sql, $connection))
    {
        die('Error : ' . mysql_error());
    }
    echo "Data have been saved.";
    mysql_close($connection);
4 Answers
Related