Dear Team, I am new on this website and also in PHP :). I need some help from experts, and I am sure my code is not up to the mark but still working on it.
My code is as below, what I do here is, I got evaluation ID from javascript and shift it to a PHP variable and it's printing that required value as well.
but when I am trying to put this variable in PHP Query, it's not passing that values due to which my PHP code is not working. However, if I pass a static value it's working fine.
$sql = 'SELECT * FROM eval where evaid="11075"';
I want to pass this $eid into this mentioned query but it's not working. Please help.
What I have tried:
<?php
$eid = "' + response[0].EvaluationId + '";
echo $eid;
$division = "' + response[0].Division + '";
echo $division;
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '123456';
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
if(! $conn ) {
die('Could not connect: ' . mysql_error());
}
$sql = 'SELECT * FROM eval where evaid="11075"';
mysql_select_db('ops');
$retval = mysql_query( $sql, $conn );
if(! $retval ) {
die('Could not get data: ' . mysql_error());
}
while($row = mysql_fetch_array($retval, MYSQL_ASSOC)) {
if ($row['division'] == "CRM Sales - Support" AND $row['etype'] == "dddd")
{
echo "downgrade ";
}
elseif ($row['division'] == "CRM Sales - Support" AND $row['etype'] == "upre")
{
echo "update";
}
elseif ($row['division'] == "CRM Sales - Support" AND $row['etype'] == "Ponly")
{
echo "Party";
}
elseif ($row['division'] == "DME")
{
echo "devide me equal";
}
else
{
echo "Open Ended";
}
}
mysql_close($conn);
?>