Note that there are some explanatory texts on larger screens.

plurals
  1. POCant Insert into SQL Table or Show all from
    primarykey
    data
    text
    <p>I cant seem to access my table. Once again I'm sure its something simple I'm overlooking. I'm not getting any errors. Nothing is being added to the table and nothing shows up. I have renamed everything several times, made sure the connection is good, made sure the table exists. I cannot see anything wrong.</p> <p>Add Data to Table</p> <pre><code> // Valid Data require_once('resources/php/db.php'); $id = uniqid(); //die ( $id . $name . $sex. $age. $hair. $eye. $skin. $body. $pf ); // Insert Data to the Table $statement1 = $db-&gt;prepare('INSERT INTO player VALUES(:player_id, :name, :sex, :age, :hair, :eye, :skin, :body, :pf)'); $result1 = $statement1 -&gt; execute(array( ':player_id' =&gt;$id, ':name' =&gt;$name, ':sex' =&gt;$sex, ':age' =&gt;$age, ':hair' =&gt;$hair, ':eye' =&gt;$eye, ':skin' =&gt;$skin, ':body' =&gt;$body, ':pf' =&gt;$pf )); // Make Sure Everything Worked if( $result1 == false ) { die('Update Failed, Please Check Your Database.'); } header("Location: ../../new_success.php?id=$id;"); exit(); </code></pre> <p>Success Page</p> <pre><code> // Start the Load $query1 = "SELECT * FROM player WHERE player_id = :player_id"; $statement1 = $db-&gt;prepare($query1); $statement1 -&gt; execute(array( ':player_id' =&gt;$id )); // Make Sure the Data Exists if( $statement1-&gt;rowCount() == 0 ) { die('Please Enter a Valid ID Tag - (id)'); } else { $notEmpty = true; } while($row = $statement1-&gt;fetch()) { $name = $row['name']; $sex = $row['sex']; $age = $row['age']; $hair = $row['hair']; $eye = $row['eye']; $skin = $row['skin']; $body = $row['body']; $pf = $row['pf']; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload