PHP, add record to MySQL data source
Posted: Sun Oct 30, 2005 8:59 am
Using a PHP page is it possible to create my own user freindly GUI to add records to my MYSQL database. I currently do this by logging into PHP MY ADMIN and doing lots of stuff in there. Sometimes i use MySQL Control Center.
Any help would be much appreciated...
Code:
Thats a part of the php page that returns the records from selected query arguments. Seeing as i have the database username and password stored in
Code:
Thanks, dragon2309
Any help would be much appreciated...
Code:
Code: Select all
<?php include "dbinfo.php";
// Connect to MySQL DBMS
if (!($connection = @ mysql_connect(DB_HOSTNAME, DB_USERNAME, DB_PASSWORD)))
showerror();
// Use the simplytruedb database
if (!mysql_select_db(DB_DATABASENAME, $connection)) showerror();
// Create SQL statement
$query = "SELECT *
FROM `ad_set`
WHERE StockCount > 0";
// Execute SQL statement
if (!($result = @ mysql_query ($query, $connection))) showerror();
// Display results
while ($row = @ mysql_fetch_array($result)) echo "
<tr><td>{$row["StockCode"]}</td>
<td>{$row["Description"]}</td>
<td>{$row["Price"]}</td>
<td><img src='{$row["IMG"]}'></img></td>
<td><center><a href='{$row["URL"]}'>$row[url]</a></center></td>
</tr>"; ?>Thats a part of the php page that returns the records from selected query arguments. Seeing as i have the database username and password stored in
Code:
Code: Select all
include "dbinfo.php";Thanks, dragon2309