Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 17th, 2003, 11:00 AM
savantmg's Avatar
savantmg savantmg is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: St. John, US Virgin Islands
Posts: 58 savantmg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 2 m 25 sec
Reputation Power: 6
Update record - not working???

Hello,

For the life of me I cannot figure out wy this is not working.

http://69.22.169.142/~limeco/add.php

Here is the PHP code:

<?php require_once('Connections/limeco_villas.php'); ?>
<?php
mysql_select_db($database_limeco_villas, $limeco_villas);
$query_villas = "SELECT * FROM villas";
$villas = mysql_query($query_villas, $limeco_villas) or die(mysql_error());
$row_villas = mysql_fetch_assoc($villas);
$totalRows_villas = mysql_num_rows($villas);
?>
<html>
<head>
<title>Lime-Coconut - Add Property</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?

if ($submit) {

// process form

$sql = "INSERT INTO villas (name,island,beds) VALUES ('$name','$island','$beds)";

$result = mysql_query($sql);

echo "Thank you! Information entered.\n";

} else{



// display form



?>
<form method="post" action="<?php echo $PHP_SELF?>">
<table width="600" border="0" align="center" cellpadding="5">
<tr bgcolor="#9999CC">
<td colspan="2">Lime-Coconut - Add a Property Listing</td>
</tr>
<tr>
<td width="146">Name: </td>
<td width="428"><input name="name" type="Text" size="30" maxlength="50"></td>
</tr>
<tr>
<td>Island:</td>
<td><input name="island" type="Text" size="30" maxlength="50"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td># Beds: </td>
<td><input name="beds" type="Text" size="30" maxlength="30"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="Submit" name="submit" value="Enter information">
</div></td>
</tr>
</table>
<p>&nbsp;</p>
</form>
<?
} // end if
?>
<? mysql_close(); ?>
</body>
</html>
<?php
mysql_free_result($villas);
?>

Any idea why it's not updating the database? It acts as if it was successful (feel free to try it) but does not add any records....

Thanks for any insight on this - I spent 5 hours yesterday trying to figure it out with no success.

EDIT----
Here is the code for the included file:

<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_limeco_villas = "host";
$database_limeco_villas = "limeco_villas";
$username_limeco_villas = "username";
$password_limeco_villas = "password";
$limeco_villas = mysql_pconnect($hostname_limeco_villas, $username_limeco_villas, $password_limeco_villas) or die(mysql_error());
?>

Last edited by savantmg : July 17th, 2003 at 11:07 AM.

Reply With Quote
  #2  
Old July 17th, 2003, 11:12 AM
computer's Avatar
computer computer is offline
echo $usertitle['computer'];
Dev Shed God 4th Plane (6500 - 6999 posts)
 
Join Date: Jan 2003
Location: UK
Posts: 6,675 computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 4 Weeks 9 h 12 m 10 sec
Reputation Power: 219
Send a message via ICQ to computer
you say at the bottom the file is called 'Connection_php_mysql.htm'

that is not the same as at the require_once because there it is limeco_villas.php

Reply With Quote
  #3  
Old July 17th, 2003, 11:20 AM
savantmg's Avatar
savantmg savantmg is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: St. John, US Virgin Islands
Posts: 58 savantmg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 2 m 25 sec
Reputation Power: 6
The whole Connections thing was generated by Dreamweaver MX.

THe included text at bottom is actually the limeco_villas.php file located under the Connections folder.

It is connecting to the database - I can run a query:

http://69.22.169.142/~limeco/homes.php?island=St. John

I also do not get a connection error, which I should if it had trouble adding to the databse, right?

Reply With Quote
  #4  
Old July 17th, 2003, 12:14 PM
savantmg's Avatar
savantmg savantmg is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: St. John, US Virgin Islands
Posts: 58 savantmg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 2 m 25 sec
Reputation Power: 6
Never mind - I found an automated insert record from in DWeaver that works without a hitch!

Reply With Quote
  #5  
Old July 18th, 2003, 10:26 AM
computer's Avatar
computer computer is offline
echo $usertitle['computer'];
Dev Shed God 4th Plane (6500 - 6999 posts)
 
Join Date: Jan 2003
Location: UK
Posts: 6,675 computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 4 Weeks 9 h 12 m 10 sec
Reputation Power: 219
Send a message via ICQ to computer
lol. you got a nice picture in your upload folder.

btw, what coding do you use to do the upload/upload2.php? if you don't mind can you pm it to me (blank your passwords )

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > Update record - not working???


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT