Jump to content

SharkEye

Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.deepbluehosting.co.uk

Profile Information

  • Gender
    Not Telling

SharkEye's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. already been there...! dont understand! was hopsing that someone could help me?
  2. hey people... you know you lot dont half work hard helping all these people out! its amazing! anyway... i have eddited the \'httpd.conf\' file ErrorDocument 404 http://jamesmills.homeip.net/error/404.php ok so when i type in http://jamesmills.homeip.net/nopage.php it goes to error page when i type in http://jamesmills.homeip.net/nopage.htm or .html it make the default error page!! any help please thanks very much
  3. thanks so much for you time mate...you never guess what it was!!! I HAD THE TABLE NAME AS userinfo doh!! that will teach me to rush into things!
  4. thanks very much for your help but that has not made it work! i added that bit of code to the script on the page that you told me to and it still does not work? anything else? i really dont know what i am doing wrong
  5. I have just set up serve on my pc and got php and mysql and stuff I am trying to get started by using a very simple script to gather data from a form and add it to the database and then read all teh data into a table. I am using a book and i have all the code right i am sure but it is not working. What i do not understand is that it worked the first tiem i did it but not anymore :S Can anyone maybe help me by testign the files on there server or somthing? or shall i post code on this site? OR does anyone know of anything (any settings) that i might have to change? Thanks veyr much James I know i have the db and table set up ok! THE FORM <form name="form1" method="post" action="handle_form.php"> <p>First Name <input name="Array[firstName]" type="text" id="sadfsdf"> </p> <p>Last Name <input name="Array[lastName]" type="text" id="Array[firstName]"> </p> <p>EMail Address <input type="text" name="Array[email]"> </p> <p>DOB <input type="text" name="Array[DOB]"> </p> <p>Info <textarea name="Array[info]"></textarea> </p> <p> <input type="submit" name="Submit" value="Submit"> </p> </form> HANDLE PAGE <?php //Database Info $host = "localhost"; $user = ""; $password = ""; $dbName = "jmusers"; $tableName = "userInfo"; //Connect to the database $link = mysql_connect($host, $user, $password); $query = "INSERT into $tableName values (\'0\', \'$Array[firstName]\',\'$Array[lastName]\',\'$Array[email]\',\'$Array[DOB]\',\'$Array[info]\')"; print "The query is:<BR>$query<P>n"; if (mysql_db_query($dbName, $query, $link)) { print "The query was successfully executed<br><br>"; } else { print "The query could not be executed"; } //close the link to the database mysql_close($link); ?> GET DB DATA PAGE <?php //Database Info $host = "localhost"; $user = ""; $password = ""; $dbName = "jmusers"; $tableName = "userInfo"; //Connect to the database $link = mysql_connect($host, $user, $password); $query = "SELECT * from $tableName"; $result = mysql_db_query ($dbName, $query, $link); //creat a table to show the table results in print "<table border=1 width ="100%" cellspacing=2 cellpadding=2 align=center>n"; print "<tr align=center valign=top>n"; print "<td align=center valigntop>Name</td>n"; print "<td align=center valigntop>EMail</td>n"; print "<td align=center valigntop>DOB</td>n"; print "<td align=center valigntop>Comments/Info</td>n"; print "</tr>n"; //fetch the results from the database while ($row = mysql_fetch_array($result)) { print "<tr align=center valign=top>n"; print "<td align=center valign=top>$row[firstName] $row[firstName]</td>n"; print "<td align=center valign=top>$row[email]</td>n"; print "<td align=center valign=top>$row[DOB]</td>n"; print "<td align=center valign=top>$row[info]</td>n"; print "</tr>n"; } //close the link to the database mysql_close($link); print "</table>n"; ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.