Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

bamboozled

New Here ,
Nov 03, 2010 Nov 03, 2010

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

TOPICS
Server side applications
357
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 04, 2010 Nov 04, 2010
Whats going on here?????????????

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 04, 2010 Nov 04, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 04, 2010 Nov 04, 2010
LATEST

Der!!!! fixed

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

works now

thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines