I'm still new to this whole PHP thing and Ive essentially created a form where if you type in the date listed in the database, it will display the events information and give you the option to edit.
Below is the code that I have constructed for the page that displays the information based on examples and tutorials.
I get an error message on the 18th line which talks about "$current_???_html .= "$current_???_html" I just put the ?? there because I figured this code is needed but Im not sure what it means or what it is suppose to be coded as. Can anyone explain this and help me get my code working. Thanks in advance!
PHP Code:
<?php
include 'session.inc.php';
include 'config.inc.php';
include 'db.inc.php';
$link = db_connect();
if ($_POST != '')
$id = $_POST['hid'];
else
$id = $_GET['id'];
$query = "SELECT ('$date','$venue','$location','$information') FROM showdates;
$result = db_query($query, $link);
if (mysql_num_rows($result)) {
$current_horses_html = "<table cellpadding=1 cellspacing=2 width=99% border=0><tr align='center' bgcolor='#cccccc'><td><B>Date</B></td><td><B>Venue</B></td><td><B>Location</B></td><td><B>Information/B></td><td colspan='2'><B>Action</B></td></tr>";
while (list($id, $date, $venue, $location, $information) = mysql_fetch_array($result)) {
$current_showdates_html .= "<tr bgcolor=#FFFFFF align=center><td>$date</td><td>$venue</td><td>$location</td><td>$information</td><td><a href='edit.php?id=$id'>Edit</a></td></tr>";
}
$current_???_html .= "<tr><td></td><td></td></tr></table>";
} else {
$current_???_html = '<p>Show does not exist. Please try again.</p>';
}
if (isset($_GET['err_msg'])) {
$err_msg = $_GET['err_msg'];
if (!empty($err_msg)) {
echo "<p><b>Error</b>:<br>$err_msg</p>";
}
}
?>
<html>
<head>
<title></title>
<link href=../admin/rustedshows.css rel=stylesheet type="text/css">
</head>
<body>
<center><img src="images/banner.jpg" border=0></center>
<br>
<table border=0 width=55% bgcolor="#BEC9D4" cellpadding=0 cellspacing=0 align=center style="border:1px solid #000;">
<tr>
<td style="padding:12px;"><h3>Update Show Details</h3></UL>
<form action="../admin/edit.php" method="post" name="Update Show Details" id="Update Show Details">
<?=$current_???_html?>
</form>
<p><br>
<a href="../admin/?logout">Logout</a> | <a href="update.php">Update Another Show</a> | <a href="admin.php">Back to Main Page</a></td>
</tr>
</table>
<center>
Design © Llora McGrath 2007</center>
</body>
</html>
Bookmarks