Jump to content


Photo

url problems?


  • Please log in to reply
2 replies to this topic

#1 Codeman0013

Codeman0013
  • Members
  • PipPip
  • Member
  • 20 posts
  • LocationCentral Illinois USA

Posted 01 September 2006 - 07:20 PM

Ok here is my thing i have done some error testing and found it has somethign to do with how the information is being taken from the url if i set a default value it works fine but if i dont then it shows up blank can anyone trouble shoot the following code and see if i'm pulling from the url wrong?

// begin Recordset
$colname__rs_employeeinfo = '1';
if (isset($HTTP_GET_VARS['employeeID'])) {
  $colname__rs_employeeinfo = $HTTP_GET_VARS['employeeID'];
}
$query_rs_employeeinfo = sprintf("SELECT * FROM employees WHERE employeeID = %s", GetSQLValueString($colname__rs_employeeinfo, "int"));
$rs_employeeinfo = $befh->SelectLimit($query_rs_employeeinfo) or die($befh->ErrorMsg());
$totalRows_rs_employeeinfo = $rs_employeeinfo->RecordCount();
// end Recordset

// begin Recordset
$colname__rs_employeeqa = '-1';
if (isset($HTTP_GET_VARS['employeeID'])) {
  $colname__rs_employeeqa = $HTTP_GET_VARS['employeeID'];
}
$query_rs_employeeqa = sprintf("SELECT * FROM staffanswers, staffquestions WHERE staffanswers.employeeID = %s AND staffanswers.staffquestionID = staffquestions.staffquestionID", GetSQLValueString($colname__rs_employeeqa, "int"));
$rs_employeeqa = $befh->SelectLimit($query_rs_employeeqa) or die($befh->ErrorMsg());
$totalRows_rs_employeeqa = $rs_employeeqa->RecordCount();
// end Recordset

Remember to always look for those dang ; they can be a killer!

#2 Caesar

Caesar
  • Members
  • PipPipPip
  • Advanced Member
  • 1,025 posts

Posted 01 September 2006 - 07:53 PM

What type of database are you using? MSSQL? MySQL?

Also:

Example URL: http://yourdomain.co...op&category=pee
<?php

$poop = $_GET[id];
$pee = $_GET[category];

$query = "SELECT * FROM table WHERE id = '$poop' && cat='$pee'";

?>

PHP Ninja

#3 Codeman0013

Codeman0013
  • Members
  • PipPip
  • Member
  • 20 posts
  • LocationCentral Illinois USA

Posted 01 September 2006 - 08:24 PM

MySql is what it is
Remember to always look for those dang ; they can be a killer!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users