Skip to main content
Participating Frequently
November 4, 2010
Question

bamboozled

  • November 4, 2010
  • 1 reply
  • 356 views

Hi All, I'm moving over from ASP to PHP so I'm not that great.

I was going along nicely now all the pages I created before with parameter queries are flagged as faulty by dreamweaver. So I go in and edit the server behavior and dreamweaver does this

$colname_rsResources = "-1";
if (isset($_GET['id'])) {
  $colname_rsResources = $_GET['id'];
}
$colname_rsResources = "-1";
if (isset($_GET('id'))) {
  $colname_rsResources = (get_magic_quotes_gpc()) ? $_GET('id') : addslashes($_GET('id'));
}

Which obviously fails

So I delete the top code and I get server errors, then deleted the new code generated by dreamweaver leaving the old code and it works.

Whats going on here?????????????

Cheers

Rem

This topic has been closed for replies.

1 reply

November 4, 2010
Whats going on here?????????????

Nobody knows what's going on because you haven't provided enough details.

RemyBlairAuthor
Participating Frequently
November 5, 2010

Sorry I wasn't clear enough

Step 1.

Create a recordset via server behavior

$paramBrandId_rsBrandInfo = "100";
if (isset($_GET('id'))) {
  $paramBrandId_rsBrandInfo = (get_magic_quotes_gpc()) ? $_GET('id') : addslashes($_GET('id'));

}
mysql_select_db($database_moshptyMySql, $moshptyMySql);
$query_rsBrandInfo = sprintf("SELECT Brands.id, Brands.brandName, Brands.brandMetaDesc, Brands.brandMetaKeyWords, Brands.brandInfo, Brands.BrandMenuName FROM Brands WHERE Brands.id=%s", GetSQLValueString($paramBrandId_rsBrandInfo, "int"));
$rsBrandInfo = mysql_query($query_rsBrandInfo, $moshptyMySql) or die(mysql_error());
$row_rsBrandInfo = mysql_fetch_assoc($rsBrandInfo);
$totalRows_rsBrandInfo = mysql_num_rows($rsBrandInfo);
?>

Step 2.

run the page

Fatal error:  Can't use function return value in write context in D:\Hosting\3756774\html\jadremtoysau\catalogue\toy-brand.php on line 35

step 3

hand code this, run the page it works, but of course dreamweaver does'nt like the hand coding and gives me a red !

$paramBrandId_rsBrandInfo = "100";
if (isset($_GET['id'])) {
  $colname_rsResources = $_GET['id'];

}
mysql_select_db($database_moshptyMySql, $moshptyMySql);
$query_rsBrandInfo = sprintf("SELECT Brands.id, Brands.brandName, Brands.brandMetaDesc, Brands.brandMetaKeyWords, Brands.brandInfo, Brands.BrandMenuName FROM Brands WHERE Brands.id=%s", GetSQLValueString($paramBrandId_rsBrandInfo, "int"));
$rsBrandInfo = mysql_query($query_rsBrandInfo, $moshptyMySql) or die(mysql_error());
$row_rsBrandInfo = mysql_fetch_assoc($rsBrandInfo);
$totalRows_rsBrandInfo = mysql_num_rows($rsBrandInfo);
?>

Thanks for looking

cheers

Rem

RemyBlairAuthor
Participating Frequently
November 5, 2010

Der!!!! fixed

I was using asp style () when I should have used []

works now

thanks