Jump to content

Search the Community

Showing results for tags 'mysqlquery'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hi I need some help with this code. I have been trying to execute this query by clicking on the search button. The query should select a the data on the web page but only the for the id entered. but I can't seem to make to button execute the query. Can somebody help me? <table border="1" align="center" cellpadding="2" cellspacing="0"> <tr> <td colspan="4"> <div align="center"> <input type="button" name="Student ID" value="Search ID" onclick="f()" /> <input type="text" name="StudentID"> <?php function f(){ $StudentID=$_POST['StudentID']; // Connect to the database $dbLink = new mysqli('', '', '', ''); if(mysqli_connect_errno()) { die("MySQL connection failed: ". mysqli_connect_error()); } // Query for a list of all existing files $sql = 'SELECT `MeetingRef`, `StudentID`, `Created`, `Progress`,`Problems` FROM `Meeting` WHERE StudentID StudentID'; $result = $dbLink->query($sql); // Check if it was successfull if($result) { // Make sure there are some files in there if($result->num_rows == 0) { echo '<p>There are no dat saved for this student in the database</p>'; } else { // Print the top of a table echo '<table width="100px"> <tr> <td align ="center"><b>Meeting Ref</td> <td align ="center"><b>Student ID</td> <td align ="center"><b>Created</b></td> <td align ="center"><b>Progress</b></td> <td align ="center"><b>Problems</b></td> </tr>'; // Print each file while($row = $result->fetch_assoc()) { echo " <tr> <td>{$row['MeetingRef']}</td> <td>{$row['StudentID']}</td> <td>{$row['Created']}</td> <td>{$row['Progress']}</td> <td>{$row['Problems']}</td> </tr>"; } // Close table echo '</table>'; } // Free the result $result->free(); } else { echo 'Error! SQL query failed:'; echo "<pre>{$dbLink->error}</pre>"; } // Close the mysql connection $dbLink->close(); } ?> </div></td> </tr> </table>
×
×
  • 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.