i am trying to use the explode function to take a variable as the string under consideratiom but its not working. can some one help me on this one please??
thanks
<?php
$hostname = "localhost";
$username = "root";
$password = "hayden";
$database = "ecng3020";
$con = mysql_connect("$hostname","$username","$password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("$database", $con);
$sql= "SELECT parameters FROM rules WHERE id='1'";
//$result=mysql_query($sql);
if ($result=mysql_query($sql))
echo '<p>nice</p>';
else
echo 'good shit';
$row = mysql_fetch_row($result);
//echo"$row[0]";
// $par= $row[0]; // this will contain the string containing the parameters
$par= explode (",",$row);
echo " $par[2]";
//$sql_1=" SELECT * course_status FROM student_course WHERE course_code ='$par'";
?>