Everything looks ok, but doesn't show up in the database???
Posted: Sun Mar 21, 2004 4:45 pm
Hello,
I have this little dillema...
This thing just doesn't want to show up in the database
1. in mysql everything is set to "all privelages"
2. connection is OK
Do you see anything wrong with this code?
If you have any idea what im doing wrong then please let me know.. Thank you in advance!
I have this little dillema...
This thing just doesn't want to show up in the database
1. in mysql everything is set to "all privelages"
2. connection is OK
Do you see anything wrong with this code?
Code: Select all
<?
include('settings.inc.php');
if($submit)
{
$sql = "INSERT INTO list
(
name,
loc,
incall,
outcall,
phone,
stat,
day,
ref,
photo,
description,
adddate,
lid,
id
) VALUES (
'$name',
'$loc',
'$incall',
'$outcall',
'$phone',
'$stat',
'$day',
'$ref,
'$photo,
'$description',
'$adddate'
'$lid',
'$id'
)";
$result = mysql_query($sql);
print ("<b><font face=arial color=red size=3>..... Added to the database.</b></font><br><br>");
include('list.inc.php');
print ("<br><b><font face=arial size=2><center><a href=list_add.inc.php>add listing</a></center></b></font><br><br>");
}
else if($update)
{
$sql_update = "UPDATE list SET
name='$name',
loc='$loc',
incall='$incall',
outcall='$outcall',
phone='$phone',
stat='$stat',
day='$day',
ref='$ref',
photo='$photo',
description='$description'
lid='$lid',
WHERE
id='$id'";
$result = mysql_query($sql_update);
print ("<b><font face=arial color=red size=3>..... Updated database.</b></font><br><br>");
include('list.inc.php');
}
else if($id)
{
$result = mysql_query("SELECT * FROM list WHERE id=$id",$db);
$info = mysql_fetch_array($result);
?>
<? include('header.inc.php'); ?>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" height=100% width="100%">
<tr>
<td width="100%" valign="top">
<form method="post" action="<? echo $PHP_SELF?>">
<input type="hidden" name="id" value="<? echo $info['id']; ?>">
Name: <input type="text" name="name" value="<? echo $info['name']; ?>"><br>
Location: <input type="text" name="loc" value="<? echo $info['loc']; ?>"><br>
Incall: <input type="text" name="incall" value="<? echo $info['incall']; ?>"><br>
Outcall: <input type="text" name="outcall" value="<? echo $info['outcall']; ?>"><br>
Phone #: <input type="text" name="phone" value="<? echo $info['phone']; ?>"><br>
Status: <input type="text" name="stat" value="<? echo $info['stat']; ?>"><br>
Referrer: <input type="text" name="ref" value="<? echo $info['ref']; ?>"><br>
Photo: <input type="text" name="photo" value="<? echo $info['photo']; ?>"><br>
Added on: <input type="text" name="adddate" value="<? echo $info['adddate']; ?>"><br>
Description:<br>
<textarea cols="40" rows="4" name="description"><? echo $info['description']; ?></textarea>
<br>
<input type="submit" name="update" value="Update Listing">
</form>
</td>
</tr>
</table>
<? include('footer.inc.php'); ?>
<?
}
else
{
?>
<? include('header.inc.php'); ?>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" height=100% width="100%">
<tr>
<td width="100%" valign="top">
<form method="post" action="<? echo $PHP_SELF?>">
Name: <input type="text" name="name"><br>
Location: <input type="text" name="loc"><br>
Incall: <input type="text" name="incall"><br>
Outcall: <input type="text" name="outcall"><br>
Phone #: <input type="text" name="phone"><br>
Status: <input type="text" name="stat"><br>
Referrer: <input type="text" name="ref"><br>
Photo: <input type="text" name="photo"><br>
Added on: <input type="text" name="adddate"><br>
Description:<br>
<textarea cols="40" rows="4" name="description"></textarea>
<br>
<input type="submit" name="submit" value="Add Listing">
</form>
</td>
</tr>
</table>
<?
}
?>
<? include('footer.inc.php'); ?>