|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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> </td> <td> </td> </tr> <tr> <td># Beds: </td> <td><input name="beds" type="Text" size="30" maxlength="30"></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td colspan="2"><div align="center"> <input type="Submit" name="submit" value="Enter information"> </div></td> </tr> </table> <p> </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. |
|
#2
|
||||
|
||||
|
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 |
|
#3
|
||||
|
||||
|
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? |
|
#4
|
||||
|
||||
|
Never mind - I found an automated insert record from in DWeaver that works without a hitch!
|
|
#5
|
||||
|
||||
|
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 ) |
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > Update record - not working??? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|