Jump to content

Search the Community

Showing results for tags 'while search pagination php m'.

  • 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 everyone can anyone help me in my code for the search i have a form i have an error this is my code for the form <form name='search' method='post' action''> <input type='text' name='searchtext'> <input type='submit' name='search' value='search'> </form> i put it after the include database on the upper side but its givig me notice undefined index: searchtext here's my php command for the pagination and results //Count the total number of row in your table*/ $count_query = mysql_query("SELECT COUNT(personid) AS numrows FROM persons"); $row = mysql_fetch_array($count_query); $numrows = $row['numrows']; $total_pages = ceil($numrows/$per_page); $reload = 'index.php'; //main query to fetch the data $query = mysql_query("SELECT * FROM persons ORDER by RAND() LIMIT $offset,$per_page"); //loop through fetched data while($result = mysql_fetch_array($query)){ $id = $result['PersonID']; echo "<div class= content > "; echo"<img height=100 width=100 src='upload/". $result['Image'] ."'/>"; echo "<font color='black'>". $result['FirstName']. "</font></br>"; echo "</div>"; i have this query // basic SQL-injection protection $searchText = htmlspecialchars ($_POST['searchText']); // query with simple search criteria $query = mysql_query("SELECT * FROM persons WHERE FirstName LIKE '%" . $searchText . "%' ORDER by RAND() LIMIT $offset,$per_page"); maybe i got wrong because at the start of the page the page start value of searchtext = nothing right is that the reason i'm getting the error? here is the output
×
×
  • 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.