alphabetical array
Posted: Wed Jul 21, 2010 9:32 am
I've got a conditional statement which would draw from a database a single letter ( in this case, g or l )
When I've put this into my if statement, I'm going straight to my else, because my coding has decided my array wants to give 1 and not g as a readout.
I have always sucked at arrays and even with the help of the php manual I'm not able to get this to work o.o
When I've put this into my if statement, I'm going straight to my else, because my coding has decided my array wants to give 1 and not g as a readout.
I have always sucked at arrays and even with the help of the php manual I'm not able to get this to work o.o
Code: Select all
<?php
$sql = "SELECT `cloth` FROM `ver_pro` where `pID` ='1' AND `prCode` = '" . $row->prCode . "'";
$cloth = mysql_query($sql) or die(mysql_error());
$cloth_data = mysql_fetch_array($cloth);
if ($cloth_data['cloth'] == 'g'){
require_once('g.php');
}
else {
require_once('l.php');
}
?>