I've tried to modify something I've found to do a CRUD form, but I'm not getting any output at all.
Here's the code I'm using
Ideas?
Thanks,
Donna
Here's the code I'm using
Code:
<?php
require_once("includes/connection.php");
?>
<table align="center" width="75%" bgcolor="black">
<tr>
<td bgcolor="white" align="center">
<font size="+2"><b>Ad Showcase Management</b></font>
<p>
<a href="formSC.php">All Records</a>
<?php
$a = ord("A");
for ($i = 0; $i < 26; $i++) {
$ltr = chr($a + $i);
// $result = mssql_query(sprintf("SELECT * FROM advertisers WHERE UPPER(SORT_NAME) LIKE '%s%%' LIMIT 1", $ltr));
// if (mssql_fetch_row($result)) {
printf("<a href=\"formSC.php?filter=alpha&criteria=%s\">%s</a> ", $ltr, $ltr);
// } else {
// echo $ltr . " ";
// }
}
?>
<br>
<?php
$a = ord("0");
for ($i = 0; $i < 10; $i++) {
$ltr = chr($a + $i);
// $result = mssql_query(sprintf("SELECT * FROM advertisers WHERE UPPER(SORT_NAME) LIKE '%s%%' LIMIT 1", $ltr));
// if (mssql_fetch_row($result)) {
printf("<a href=\"manageSC.php?filter=alpha&criteria=%s\">%s</a> ", $ltr, $ltr);
// } else {
// echo $ltr . " ";
// }
}
?>
</td>
</tr>
</table>
<?php
if ($_REQUEST["criteria"]) {
$result = mssql_query(sprintf("SELECT * FROM advertisers WHERE UPPER(sort_name) LIKE '%s%%'", $_REQUEST["criteria"]));
} else {
$result = mssql_query("SELECT * FROM advertisers ORDER BY sort_name");
}
$found = 0;
?>
<table width="75%" align="center" bgcolor="black" cellspacing="1">
<tr>
<td width="75%"><font color="white"><b>Advertiser</b></font></td>
<td align="center"><font color="white"><b>Actions</b></font></td>
</tr>
<tr><td bgcolor="white"> </td><td bgcolor="white" align="center"><font size="1"><a href="formSC.php">Add New</a></font></td></tr>
<?php
while ($rec = mssql_fetch_array($result, MSSQL_ASSOC)) {
?>
<tr>
<td bgcolor="white"><?php echo $rec["advertiser_name"] ?></td>
<td bgcolor="white" align="center"><font size="1">
<a href="formSC.php?mode=edit&ID=<?php echo $rec["advertiser_id"] ?>">Edit</a>
<a href="formSC.php?mode=delete&ID=<?php echo $rec["advertiser_id"] ?>">Delete</a>
</font></td>
</tr>
<?php
}
if (!$found) {
?>
<tr><td colspan="2" bgcolor="white"></td></tr>
<?php
}
?>
</table>
<?php
}
?>
Ideas?
Thanks,
Donna