|
||||||
| Database & Database Programming MySQL, Oracle, SQL, PL/SQL, ABAP, Smart Forms, and other databases and languages. A database is an organized body of related information used in many websites (including CC). |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Hi, okay so I am new to databasing but I have been following some tutorials to try to get started, I have a database created with a table. Here is the code I am using to try to input the values into the table.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <p>The Official try at this ****</p> <input type="submit" /> <?php $con = mysql_connect(server , username, pw); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("eventdb", $con); mysql_query("INSERT INTO title (Title, Host, Place) VALUES ('Peter', 'Griffin', '35')"); mysql_close($con); ?> <p> </p> </body> </html> The username/pw/server is all correct it connects fine, but the values are not inserted into the table for some reason. I have tried upper case and lower case just to try on the collumns. The database is called eventdb and the table is called title and the columns are called Title, Host, Place. Any idea why this code isn't working? I am building in DreamWeaver. Also... another side question, when does the page know when to run the php? when it loads? |
| Sponsored Links |
|
|
|
|||
|
Hi, thanks for the reply, I added that line in and nothing happened still. I am going to guess that either the php code isn't running or the error isn't outputting. Any idea which it would be? How does the form know to call to the php code when the button is clicked?
|
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Retrieving Access Database | tigger | Visual Basic Programming | 0 | 07-06-2007 01:27 AM |
| Best program for SQL database manipulation | Rhadamanthys | Database & Database Programming | 3 | 07-02-2007 03:32 PM |
| Best way to save lots of small values (in a database)? | Vantage | General Programming | 2 | 05-14-2007 08:57 AM |
| Small job - Database extraction - Delphi 7 of compliant | paul. | Request Services (Paid) | 4 | 04-11-2007 12:41 PM |
| Sudoku can be solved using SQL..Take a look! | roger | Database & Database Programming | 5 | 07-04-2006 03:20 PM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |
Goal: 100,000 Posts
Complete: 98%