
Originally Posted by
singersower
I finally installed apache, mysql and PHP and I'm trying to find a faster way to input TONS of content: sermons, into a db for a church website. How would this work?
<?php
mysql_connect("localhost","root",);
mysql_select_db (heart);
$query = "INSERT INTO heart(text , title)
VALUES('$text','$title')";
$result = mysql_query($query);
echo 'Item Entered.';
?>
allette
You will want to be inserting that into the table, not the database.
If you have a database structure like below.
-Database1
--Table 1
--Table 2
The your code would be like:
PHP Code:
<?php
mysql_connect("localhost","root",);
mysql_select_db (database1);
$query = "INSERT INTO table1(text , title) // Before you were trying to insert into the actual database
VALUES('$text','$title')";
$result = mysql_query($query);
echo 'Item Entered.';
?>
HTH
Bookmarks