[RESOLVED] new to php mysql
hi all
ive setup a sql db and php server.
ive never used it before. i like to use ms access. so new ground for me... and i must say its faster and lest of a hassle keeping track of everything.
i have managed to get a list of everything on the database list but now i want to filter out out stuff. (make the list smaller and what i need.
i have posted my basic connection with shanged password and user info.
can anyone help:confused::confused:
PHP Code:
<html>
<head><title>video list basic</title>
<style type="text/css">
td {font-family: tahoma, arial, verdana; font-size: 10pt }
</style>
</head>
<body>
<?php
/* Change next two lines */
$db="vdidb";
$link = mysql_connect('localhost: 3306', 'youruser', 'your password');
if (! $link)
die(mysql_error());
mysql_select_db($db , $link)
or die("Couldn't open $db: ".mysql_error());
// $result = mysql_query( "SELECT vidnumber, videotitle, age, Runningtime, starring, hd, trilogy FROM videolist")
$id = "%".$_GET["search"]."%";
$result = mysql_query( "SELECT vidnumber, videotitle, age, Runningtime, werestoredFolder FROM videolist")
or die("SELECT Error: ".mysql_error());
$num_rows = mysql_num_rows($result);
print "There are $num_rows records.<P>";
print "<table width=200 border=1>\n";
while ($get_info = mysql_fetch_row($result)){
print "<tr>\n";
foreach ($get_info as $field)
print "\t<td>$field</td>\n";
print "</tr>\n";
}
print "</table>\n";
mysql_close($link);
?>
<br>
</body>
</html>
Re: [RESOLVED] new to php mysql
err. method="query" is not valid. if you want to have your form variables be available to the query string, your method should be "get." your form only works because if the browser doesn't know what method you're trying to use, it will use get by default.
Re: [RESOLVED] new to php mysql
hi kows
i have now changed it to get.
im learning this php stuff as i go. thank again