mysql_query help

xsystemx

New Member
Messages
4
Reaction score
0
Points
0
Code:
<div id="col-two">
<div class="boxed">
<h2 class="title">SUBMIT</h2>
<div class="content">
<p>
<? 
$A = $_POST['Artist']; 
$B = $_POST['Album']; 
$C = $_POST['Song'];
$D = $_POST['GuitarX'];
$E = $_POST['GuitarH'];
$F = $_POST['GuitarM'];
$G = $_POST['GuitarE'];
$H = $_POST['BassX'];
$I = $_POST['BassH'];
$J = $_POST['BassM'];
$K = $_POST['BassE'];
$L = $_POST['DrumsX'];
$M = $_POST['DrumsH'];
$N = $_POST['DrumsM'];
$O = $_POST['DrumsE'];
$P = $_POST['Download'];
$sqlQuery1 = "SELECT * FROM `ARTIST` WHERE `ARTIST` = '$A' LIMIT 0 , 1";
$sqlQuery2 = "SELECT * FROM `ALBUM` WHERE `ARTIST` = '$A' AND `ALBUM` = '$B' AND `YEAR` = '$C' AND `ART` = '$D' LIMIT 0 , 1";
$sqlQuery3 = "INSERT INTO `xsystemx_songs`.`ARTIST` (`id` ,`ARTIST`) VALUES (NULL , '$A');";
$sqlQuery4 = "INSERT INTO `xsystemx_songs`.`ALBUM` (`ID` ,`ARTIST` ,`ALBUM` ,`YEAR` ,`ART` )VALUES (NULL , '$A', '$B', '', '');";
$sqlQuery5 = "INSERT INTO `xsystemx_songs`.`SONG` (`ID` ,`ARTIST` ,`ALBUM` ,`SONG` ,`DISC` ,`TIME` ,`TRACK` ,`CAREER` ,`TIER` ,`DOWNLOAD` ,`GX` ,`GH` ,`GM` ,`GE` ,`BX` ,`BH` ,`BM` ,`BE` ,`DX` ,`DH` ,`DM` ,`DE` )VALUES (NULL , '$A', '$B', '$C', 'NULL', 'NULL', 'NULL', NULL , NULL , '$P', '$D', '$E', '$F', '$G', '$H', '$I', '$J', '$K', '$L', '$M', '$N', '$O');"; 
mysql_connect("localhost", "", "") or die(mysql_error());
mysql_select_db("") or die(mysql_error());
 

[B]//THIS IS THE PART I NEED HELP DOING START[/B]
 
 
[B]if($A == "$sqlQuery1"){echo "VALID ARTIST";} 
else{mysql_query("$sqlQuery3"); echo "NEW ARTIST";}
if($B == "$sqlQuery2"){echo "VALID ALBUM";} 
else{mysql_query("$sqlQuery4"); echo "NEW ALBUM"; }[/B]
 
 
[B]//THIS IS THE PART I NEED HELP DOING END[/B]

 
mysql_query("$sqlQuery5")
?>
</p>
</div>
</div>
</div>
 
Last edited:

trike97

New Member
Messages
5
Reaction score
0
Points
0
try connecting to the database before you run a query, in other words

$sqlQuery1 = null

unless you connect to the DB first.
 
Top