Hi Guys...
I need some help with this PHP script in Dreamweaver (I wasn't sure where to post it so I also posted it in the Dreamweaver section also ).
I have no experience what so ever with PHP so have no idea what the problem is. The script is obviously auto generated by Dreamweaver and nothing has been changed manually.
On using the Live Data option, I get an error saying "Parse error: parse error, expecting `'," or `')" in /Users/hnm/Sites/myresults_23ul2krtr1.php on line 2"
The script is as follows and is called myresults.php (also note that the text appearing in the hashes i.e. #gname# and #dname# etc. appears in yellow in the script in Dreamweaver and I have no idea what that signifies):
<?php require_once('Connections/newconn.php'); ?>
<?php
$gname_rsresults = "%";
if (isset(#gname#)){
$gname_rsresults = (get_magic_quotes_gpc()) ? #uname# : addslashes(#uname#);
}
$gname_rsresults = "%";
if (isset(#gname#)) {
$gname_rsresults = (get_magic_quotes_gpc()) ? #uname# : addslashes(#uname#);
}
$dname_rsresults = "%";
if (isset(#dname#)) {
$dname_rsresults = (get_magic_quotes_gpc()) ? #deptname# : addslashes(#deptname#);
}
mysql_select_db($database_newconn, $newconn);
$query_rsresults = sprintf("SELECT name, dptname FROM testtable WHERE name='%s' AND dptname='%s'", $gname_rsresults,$dname_rsresults);
$rsresults = mysql_query($query_rsresults, $newconn) or die(mysql_error());
$row_rsresults = mysql_fetch_assoc($rsresults);
$totalRows_rsresults = mysql_num_rows($rsresults);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="510" border="0">
<tr>
<th width="224" scope="col">Employee Name </th>
<th width="276" scope="col">Department name </th>
</tr>
<tr>
<td><div align="center"><?php echo $row_rsresults['name']; ?></div></td>
<td><div align="center"><?php echo $row_rsresults['dptname']; ?></div></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($rsresults);
?>
Any help would be appreciated.
Thanks.
I need some help with this PHP script in Dreamweaver (I wasn't sure where to post it so I also posted it in the Dreamweaver section also ).
I have no experience what so ever with PHP so have no idea what the problem is. The script is obviously auto generated by Dreamweaver and nothing has been changed manually.
On using the Live Data option, I get an error saying "Parse error: parse error, expecting `'," or `')" in /Users/hnm/Sites/myresults_23ul2krtr1.php on line 2"
The script is as follows and is called myresults.php (also note that the text appearing in the hashes i.e. #gname# and #dname# etc. appears in yellow in the script in Dreamweaver and I have no idea what that signifies):
<?php require_once('Connections/newconn.php'); ?>
<?php
$gname_rsresults = "%";
if (isset(#gname#)){
$gname_rsresults = (get_magic_quotes_gpc()) ? #uname# : addslashes(#uname#);
}
$gname_rsresults = "%";
if (isset(#gname#)) {
$gname_rsresults = (get_magic_quotes_gpc()) ? #uname# : addslashes(#uname#);
}
$dname_rsresults = "%";
if (isset(#dname#)) {
$dname_rsresults = (get_magic_quotes_gpc()) ? #deptname# : addslashes(#deptname#);
}
mysql_select_db($database_newconn, $newconn);
$query_rsresults = sprintf("SELECT name, dptname FROM testtable WHERE name='%s' AND dptname='%s'", $gname_rsresults,$dname_rsresults);
$rsresults = mysql_query($query_rsresults, $newconn) or die(mysql_error());
$row_rsresults = mysql_fetch_assoc($rsresults);
$totalRows_rsresults = mysql_num_rows($rsresults);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="510" border="0">
<tr>
<th width="224" scope="col">Employee Name </th>
<th width="276" scope="col">Department name </th>
</tr>
<tr>
<td><div align="center"><?php echo $row_rsresults['name']; ?></div></td>
<td><div align="center"><?php echo $row_rsresults['dptname']; ?></div></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($rsresults);
?>
Any help would be appreciated.
Thanks.