Jump to content

whojstall11

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

whojstall11's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Can anybody help me with some code basically my website was shtml it worked perfectly then i wanted to add some php code to it. NOW the php works but the format of my website has changed and it will no longer accept my shtml. i also already changed every .shtml in my websites folder to php and I already have AddType text/html .shtml AddOutputFilter INCLUDES .shtml in my httpd.conf what do i do next.
  2. Im try to write an else statement in php where: if keyword is equal to letter or word it will give me an error message. right now my statement looks like this. mysqli_stmt_close ($query); } else //problem with a query echo "Error: " . mysqli_error($conn); } else { //no keyword echo "No keyword was specified"; }else (keyword == "??") { echo "has to be a number"; } mysqli_close($conn); } ?> </body> </html> Keyword is an int
  3. OMG thank you thanks for the explain too great work
  4. My code keeps giving me and error on 22 saying: Warning: mysqli_stmt_bind_param() [function.mysqli-stmt-bind-param]: Number of variables doesn't match number of parameters in prepared statement in E:\xampp\htdocs\m9\findRecords2.php on line 22 <html> <head> <title>Display Records</title> </head> <body> <?php $conn = new mysqli("localhost", "proxy_user", "my*password", "m9"); if (mysqli_connect_errno()){ echo 'Cannot connect to database: ' . mysqli_connect_error($conn); } else{ //read keyword from user if(!empty($_POST["keyword"])){ $keyword = $_POST["keyword"]; // create prepared statement if ($query = mysqli_prepare($conn, "SELECT FirstName, LastName, Age, Hometown, Job FROM people WHERE age <='" . $keyword ."' " )) { // bind parameters mysqli_stmt_bind_param ($query, "i", $keyword); //run the query and keep results in $result variable mysqli_stmt_execute($query); // bind variables to prepared statement mysqli_stmt_bind_result($query, $FirstName, $LastName, $Age, $Hometown, $Job); // fetch values while (mysqli_stmt_fetch($query)) { echo "<strong>$LastName, $FirstName</strong> from $Hometown<br/>age: $Age, occupation: $Job <br/><br/>"; } //free memory used by a result handle mysqli_stmt_close ($query); } else //problem with a query echo "Error: " . mysqli_error($conn); } else { //no keyword echo "No keyword was specified"; } mysqli_close($conn); } ?> </body> </html> keyword and age are ints can anybody please help
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.