Codeman0013 Posted September 1, 2006 Share Posted September 1, 2006 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?[code=php:0]// 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[/code] Link to comment https://forums.phpfreaks.com/topic/19400-url-problems/ Share on other sites More sharing options...
Caesar Posted September 1, 2006 Share Posted September 1, 2006 What type of database are you using? MSSQL? MySQL?Also:Example URL: http://yourdomain.com/index.php?id=poop&category=pee[code]<?php$poop = $_GET[id];$pee = $_GET[category];$query = "SELECT * FROM table WHERE id = '$poop' && cat='$pee'";?>[/code] Link to comment https://forums.phpfreaks.com/topic/19400-url-problems/#findComment-84222 Share on other sites More sharing options...
Codeman0013 Posted September 1, 2006 Author Share Posted September 1, 2006 MySql is what it is Link to comment https://forums.phpfreaks.com/topic/19400-url-problems/#findComment-84240 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.