Jump to content

blackhawk08

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

blackhawk08's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. yes, everything works until i try adding the mysql_connect() command
  2. still no output, i have all error reporting on, what reasons could there be for no output? [move]*BlackHawk starting to get annoyed*[/move]
  3. im at a complete loss here...reinstalled everything...now im using a WAMP bundle...cant seem to figure out whats going on...here's my latest code <html> <head> <title>add info into sql</title> </head> <body> <?php include 'dbconnect.php'; { $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; $age = $_POST['age']; $query = "INSERT INTO Person('FirstName', 'LastName', 'Age'); mysql_query($query) or die('Error, Insert query failed'); mysql_Close($conn) echo 'new data added'; } else { ?> <form method="post"> <table width="400" border="0" cellspacing="1" cellpadding="2"> <tr> <td width="100">Firstname</td> <td><input name="Firstname" type="text" id="firstname"></td> </tr> <tr> <td width="100">lastname</td> <td><input name="lastname" type="text" id="lastname"></td> </tr> <tr> <td width="100">age</td> <td><input name="age" type="text" id="age"></td> </tr> <tr> <td width="100"> </td> <td> </td> </tr> <tr> <td width="100"> </td> <td><input name="add" type="submit" id="add" value="Add New Info"></td> </tr> </table> </form> <?php } ?> </body> </html> and the dbconnect.php is: <?php // Connect to the database $host = "127.0.0.1:3307"; // db host $user = "root"; // db username $pass = "ind34dol"; // db password $db = "testing"; // db name $connection = mysql_connect ($host, $user, $pass) or die ("Unable to connect"); mysql_select_db ($db) or die ("Unable to select database"); ?> what am i missing here? where am i screwing up? im not getting ANY output, not even the form that i created..NOTHING
  4. no change...but that did make a lot of sense...im going to try reinstalling php, and check my sql configs...been awhile since ive worked with this stuff, maybe i messed soemthing up last time i tried this stuff
  5. this creates no output, not even in the source <html> <head> <title>Example</title> </head> <?php include 'dbconnect.php'; $query = "SELECT * FROM Person"; $result = mysql_query($sql); $people = array(); while($row = mysql_fetch_array($result)){ $people[] = $row; } ?> <body> <?php die("<pre>" . print_r($people,true) . "</pre>"); ?> </body> </html> the included file is: <?php // Connect to the database $host = "localhost"; // db host $user = "root"; // db username $pass = "********"; // db password $db = "testing"; // db name $connection = mysql_connect ($host, $user, $pass) or die ("Unable to connect"); mysql_select_db ($db) or die ("Unable to select database"); ?>
  6. anyone? i cant get this thing frustration is kicking in...
  7. i tried doing that and added echo 'test approved'; at the end, and nothing printed
  8. im having a real hard time...i cant figure out why this wont work...anyone got any ideas? the code is at http://pastebin.ca/452773 ??? ??? ??? ??? ???
×
×
  • 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.