I inherited a WordPress website a while back that had some custom code added via the insert_php plugin. It had been running fine and apparently was an important part of their website I didn't realize. I'm not a programmer, just the jack of all trades IT person. Anyway, I noticed the most basic MySQL commands can be fixed with "i" and that the mysqli_connect command will now accept a 4th parameter of the dbname. I'm not sure where to truncate the code It's very small and uses a WordPress shortcode (Which I will create a (real snippet). I also read the query and fetch_array are way off. Any advice? Heres what I have:
$con = mysql_connect("127.0.0.1","123xxxxxxx","4444444444444");
if (!$con) {
die("Can not connect:" . mysql_error());
}
mysql_select_db("dbxxxxx",$con);
$sql = 'SELECT * FROM EmployeeTable where PrimaryCampusPerson="Yes" order by SchoolDistrict, Site';
$myData = mysql_query($sql,$con);
echo "
";
while($record = mysql_fetch_array($myData)){
echo "
";
echo "";
echo "
";
echo "
";
echo "
";
}
echo "
Campus District Program Manager
" . "" . $record['Site'] . "" . "
" . $record['WorkAddress'] . "
" . $record['WorkCity'] . $record['WorkState'] . $record['WorkZip'] ."
" . $record['SchoolMainPhone'] ." " . $record['SchoolDistrict'] . " " . "" . $record['LastName'] . ", " . $record['FirstName'] . "" . "
" . $record['WorkCISPhone'] ."
" . "". $record['Email'] . "" ."
";
[/insert_php]````