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