Jump to content

TylerRLD

New Members
  • Posts

    2
  • Joined

  • Last visited

TylerRLD's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Mysql version 5.0 Currently i have it set up for high scores. I can correctly send NAME and SCORE to the mysql table. It is set up to automatically assign an "id" to the input using auto_increment. How can i ask the server for the "id" after i input the name and score and then print it on the page?
  2. I currently have a php set up for a high-scores list. The mysql database has 3 fields. 1-id 2-Name 3-Score id is set to auto increment ive got it working to properly input name and score into the database and it automatically gives the entry an "id"... heres the code: $dbc = mysql_connect('ZShiscoreapp.db.10895904.hostedresource.com','username','password'); if (!$dbc) { die('Not Connected :' .mysql_error()); } $db_selected = mysql_select_db("ZShiscoreapp", $dbc); if (!$db_selected) { die("Cant Connect : " .mysql_error); } $pname=$_GET['nameinput']; $pscore=$_GET['scoreinput']; $query="INSERT INTO highs SET Score='$pscore', Name='$pname' "; $result=mysql_query($query); I want to get the assigned "id" from the database and print it. how can i do this?
×
×
  • 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.