Website built [check]
database set up using phpmyadmin and verified to work with below code [check]
<?php
//Sql Connection.php
require_once("database.php");
$dbRecords = mysql_query("SELECT * FROM pwd", $dbLocalhost)
or die ("Problem reading table:" . mysql_error());
echo "<h1> Connected to Database yay! </h1>";
?>
database.php file
<?php
//database.php
$dbLocalhost = mysql_connect("localhost","root")
or die("Could not Connect: " . mysql_error());
mysql_select_db("users",$dbLocalhost)
or die ("Could not find database:" . mysql_error());
echo "<h1> Connected to Database</h1>";
?>
Okay, so now I need to have the website update the database. Simple concept - just adding new users so it's two fields. Username and password.
I'm pretty new to this (school assignment) so I've been looking around online the last couple of days.
I've created a config.php file (not sure if I need this?) But I'm still not getting any luck having the site update to the database.
My questions :
Does the config.php file need to be referenced on all of the html pages on the website?
What other steps are missing? (it seems like there's something else that needs to be running between the site and db).
I am running WAMP5 for a local server.
Any thoughts or a push in the right direction would be awesome!
Thanks,
D

New Topic/Question
Reply




MultiQuote




|