Hello fourm members this is my first post. I am having a problem with a string in my code and cant figure it out... here is the code maybe someone here can assist me.
thanks in advance
-dellux
*#*#*#*#*#*#*#*#*#*#*#
<html>
<head>
<title>Loggin DB</title>
</head>
<body>
<body bgcolor="#82CAFA">
<form method="get" action="loggin1.php">
Page:
<select name="Page">
<option value="approve.php" >Approve</option>
<option value="custquery" >CustQuery</option>
<option value="slpnlogin">SlpnLogin</option>
</select>
User Code:
<select name="User Code">
<option >T3</option>
<option >J9</option>
<option>BL</option>
<option >SC</option>
<option >MN</option>
<option >CA</option>
<option>MW</option>
<option >TJ</option>
<option >E2</option>
</select>
Date:
<input type="text" name="Date">
<p><input type="submit" value="send"/></p></form>
<?php
echo $_GET['Page'];
$db = $_SERVER['DOCUMENT_ROOT']."/../data/log.db"; //connect to sql
$handle = sqlite_open($db);
$query = "SELECT * FROM log where id > 85076";
if ($_GET["Page"] !="")
{
$query.=" 'and page=" .$_GET["Page"]. "and userCode=" .$_GET["UserCode"].'and time=' .$_GET['Time']."";
}
echo $query;
$result = sqlite_query($handle, $query);
$row = sqlite_fetch_array( $result );
echo "<table>";
while($row = sqlite_fetch_array($result)){
echo " <tr>\n";
echo " <td> $row[id]</td><td> $row[page]</td> <td> $row[desc] </td><td> $row[userCode] </td><td> $row[codeType] </td><td>". date( "Y-m-d", $row['time'])."</td><td> $row[ipaddr]</td>\n";
echo " </tr>\n";
}
echo "</table>";
?>
</html>
*#*#*#*#*#*#*#*#*#*#*#
this is the error I recieve
*#*#*#*#*#*#*#*#*#*#*#
Notice: Undefined index: UserCode in c:\program files\Apache\htdocs\loggin1.php on line 36
Notice: Undefined index: Time in c:\program files\Apache\htdocs\loggin1.php on line 36
SELECT * FROM log where id > 85076 'and page=custqueryand userCode=and time=
Warning: sqlite_query() [function.sqlite-query]: near "'and page=custqueryand userCode=and time=": syntax error in c:\program files\Apache\htdocs\loggin1.php on line 39
Warning: sqlite_fetch_array() expects parameter 1 to be resource, boolean given in c:\program files\Apache\htdocs\loggin1.php on line 40
Warning: sqlite_fetch_array() expects parameter 1 to be resource, boolean given in c:\program files\Apache\htdocs\loggin1.php on line 42
*#*#*#*#*#*#*#*#*#