Jump to content

Mumlebumle

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Everything posted by Mumlebumle

  1. Why doesnt this query work, i does update, thats not the problem, but the "AND reimburse.check = 0";" does not function and just keeps on running the script. It is supposed to be there to give out an error so that if one updates it shortly after another the 2nd one will be aware its already been done. $sql2 = "UPDATE reimburse SET reimburse.check = 1 WHERE reimburse.kill_id = $bursekillid AND reimburse.check = 0"; mysql_query($sql2)or die(mysql_error());
  2. Thanks, i found the unique button beside the primary and used that one, it worked, now getting Duplicate entry '30' for key 'kill_id' :D
  3. Hi, Can i make so the mysql columns cant have the same number, such as if the row 1, column 1 have the value 30, and then the row 2 column 1 cant be 30, but can be 31?.. The problem is i have an auto increment id before thoose, and then the stuff being added will just keep being added, but just to a new id. hereby more of 1 type can occur. $sql = "INSERT INTO reimburse VALUES ('','$reimbursekillid','')"; mysql_query($sql)or die(mysql_error());
  4. So i started on a project and not within long, i hit a wicked wall. The upper part works fine, i get the correct $pilotcorpid, however it doesnt seem to query the 2nd time, it just uses the variable from the first time. I have the information in the database, i just need to pick em out right. <?php include 'config.php'; //database config include 'opendb.php'; //connect database $search = @$_GET['q'] ; //getting a name from a form $result = mysql_query("SELECT * FROM kb3_pilots WHERE plt_name='$search'")or die(mysql_error()); //here i choose to check in the kb3_pilots table, the plt_name column for the name written in the form earlier. $pilotcorpid=mysql_result($result,"plt_crp_id"); //since i found the guy in the query, i need info from that column, the plt_crp_id. $resultcorp = mysql_query("SELECT * FROM kb3_corps WHERE crp_id='$pilotcorpid'")or die(mysql_error()); //now we query the kb3_corps table to check if the corp exists. $pilotcorpname=mysql_result($resultcorp,"crp_name"); //Because it did, i will now pull out the name echo "TEST: Pilot Id: $pilotcorpid and corp name: $pilotcorpname"; include 'closedb.php'; ?> If somebody also have a big php/mysql ebook which explains commands great, that would be awesome. Best regards, Mumlebumle
×
×
  • 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.