Her you go, this one Reads the Database table, Change the DB parts to yours
and have fun.
Here is a good start as well
http://www.devshed.com/Server_Side/PHP/DB_Basics/

----
<html>

<head>
</head>

<body>
<?php

// set up some variables

// server name
$server = "localhost";

// username
$user = "youofcourse";

// password
$pass = "yourpword";

// database to query
$db = "yourdb";

// open a connection to the database
$connection = mysql_connect($server, $user, $pass) or
die("Invalid server
or user");


// formulate the SQL query
$query = "select * from url_list" or die("Error in query");

// run the query on the database
$result = mysql_db_query($db, $query, $connection) or
die("Error in query");

// display the result
echo "<table width=450 border=1 cellspacing=0
cellpadding=0>";
echo "<tr><td width=150 align=left>User</td><td width=100
align=left>Site
#1</td><td width=100 align=left>Site #2</td><td width=100
align=left>Site
#3</td></tr>";

// with a while loop
// this loop will iterate as many times as there are records
// and return an array named $myrow
while ($myrow = mysql_fetch_row($result))
{   
echo "<tr><td width=150 align=left>$myrow[0]</td><td width=100
align=left><a href=$myrow[2]>$myrow[1]</a></td><td width=100 align=left><a
href=$myrow[4] >$myrow[3]</a></td><td width=100 align=left><a
href=$myrow[6]> $myrow[5]</a></td></tr>";       
}

// memory flush
mysql_free_result($result);

?>

</body>
</html>






-----Original Message-----
From: Stephen Reynolds [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 26, 2001 11:28 PM
To: [EMAIL PROTECTED]
Subject: Update or delete a record using PHP and HTML forms




Could someone post some sample code to get me started on loading records 
into an HTML form using PHP and SQL so that I can update or delete a record.

Regards, Steve


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to