Okay so I have this really simple form that looks up values in my db tables. I haven't fully completed it yet and I was chugging along okay until I wanted to use a Jquery datepicker(I want to be able to easily select within a large custom set of years).
Due to my own reasons, the tables on my db don't use total date values so I split up the value into strings to lookup (worked fine with html5, but its not seeming to work with jquery)
Well, now I get "Call to a member function data_seek() on a non-object in" on my code. I've been tearing it apart and trying to fix things for several hours now and I kindly seek your help SO community:
Here is the PHP code:
<?php
$estring = substr($_POST[idvalue],-10, 5);
$wstring = substr($_POST[idvalue],6);
$mysqli = mysqli_connect("localhost", "usr", "", "xyz");
echo $estring."<br>";
echo $wstring;
$stmt = $mysqli->prepare('SELECT * FROM western WHERE id = ?');
$stmt->bind_param('s', $wstring);
$stmt->execute();
while ($row = $stmt->fetch()) {
echo "sign: ". $row['Western Zodiac Description']."<br>";
echo " Birth Card: = " . $row['Birth Card'];
echo " : =" . $row['Birth Card Descripton']."<br>";
echo "Planetary Card =". $row['Planatray Card'];
echo " : ". $row['Planatary Card Description']."<br>";
echo " 2nd Planetary Card =". $row['2nd Planatray Card'];
echo ": " . $row['2nd Planatary Card Description']."<br>";
}
$mysqli->close();
?>
Here is the frontend HTML:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>project </title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<script>
$(function() {
$( "#datepicker" ).datepicker({
yearRange: "1645:2112",
changeMonth: true,
changeYear: true
});
});
</script>
</head>
<body>
<br>
<form action="outputb.php" method="post">
enter date: <input type="text" id="datepicker" name='idvalue'>
<br>
<br>
<input type="submit" value="Search"/>
</form>
</body>
</html>