I have a variable like "Doctor and Surgical" I take this value from Mysql database and store it in a variable. When I echo this variable it gives me only "Doctor" Can anyone tell me how can I take the above value retrieved from Mysql as an entire variable...
EDIT
请参阅以下守则:
query.php
<form action="process.php" method="post">
<select name="cat">
<?php
$sql="select distinct Category from tbl_1 order by Category asc";
$query=mysql_query($sql);
while($row=mysql_fetch_array($query))
{
echo "<option value=".$row[Category].">".$row[Category]."</option>";
}
?>
</select>
<select name="station">
<?php
$sql_1="select distinct Station from tbl_1 order by Station asc";
$query_1=mysql_query($sql_1);
while($row=mysql_fetch_array($query_1))
{
echo "<option value=".$row[Station].">".$row[Station]."</option>";
}
?>
</select>
<input name="C" type="submit" />
</form>
process.php
$myValue =$_POST[ cat ];
$myStation=$_POST[ station ];
echo $myValue;
echo "<br/>";
echo $myStation;
$mySqlStm ="SELECT Name FROM tbl_1 WHERE Category= $myValue and Station= $myStation ";
$result2 = mysql_query($mySqlStm) or die("Error:mysql_error()");
if(mysql_num_rows($result2) == 0){
echo("<br/>no records found");
}
ELSE
{
echo "<table border= 1 >";
//ECHO THE RECORDS FETCHED
while($row = mysql_fetch_array($result2))
{
echo "<tr>";
echo "<td>" . $row[ Name ] . "</td>";
}}
Here when I echo $myValue it gives me "Doctor" instead of "Doctor and Surgeon" I need "Doctor and Surgeon as an entire variable.