Jump to content

Search the Community

Showing results for tags 'search'.

  • 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

  1. Hello, i have a question about the results in the browser where you search. I want that this, Search+source+code&page=36 Search+source+code&page=72 Search+source+code&page=108 to change it like this, when you click next or 2 3 4 5 etc Search+source+code&page=2 Search+source+code&page=3 Search+source+code&page=4 is that possible ? here below the complete script <?php $button = $_GET ["submit"]; $search = $_GET ["search"]; if(strlen($search)<=1) echo "Search term too short"; else{ echo "You searched for <b>$search</b> <hr size='1'></br>"; mysql_connect("mysql_host_name","mysql_username","mysql_password"); mysql_select_db("database_name"); $search_exploded = explode (" ", $search); foreach($search_exploded as $search_each) { $x++; if($x==1) $construct .="title LIKE '%$search_each%'"; else $construct .="AND title LIKE '%$search_each%'"; } $constructs ="SELECT * FROM database_table_name WHERE $construct"; $run = mysql_query($constructs); $foundnum = mysql_num_rows($run); if ($foundnum==0) echo "Sorry, there are no matching result for <b>$search</b>.</br></br>1. Try more general words. for example: If you want to search 'how to create a website' then use general keyword like 'create' 'website'</br>2. Try different words with similar meaning</br>3. Please check your spelling"; else { echo "$foundnum results found !<p>"; $per_page = 36; $page = $_GET["page"]; $max_pages = ceil($foundnum / $per_page); if(!$page) $page=0; $getquery = mysql_query("SELECT * FROM database_table_name WHERE $construct LIMIT $page, $per_page"); while($runrows = mysql_fetch_assoc($getquery)) { $title = $runrows ["title"]; $desc = $runrows ["description"]; $url = $runrows ["url"]; echo " <a href='$url'><b>$title</b></a><br> $desc<br> <a href='$url'>$url</a><p> "; } //Pagination pages echo "<center>"; $prev = $page - $per_page; $next = $page + $per_page; $adjacents = 3; $last = $max_pages - 1; if($max_pages > 1) { //previous button if (!($page<=0)) echo " <a href='search.php?search=$search&submit=Search+source+code&page=$prev'>Prev</a> "; //pages if ($max_pages < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up { $i = 0; for ($counter = 1; $counter <= $max_pages; $counter++) { if ($i == $page){ echo " <a href='search.php?search=$search&submit=Search+source+code&page=$i'><b>$counter</b></a> "; } else { echo " <a href='search.php?search=$search&submit=Search+source+code&page=$i'>$counter</a> "; } $i = $i + $per_page; } } elseif($max_pages > 5 + ($adjacents * 2)) //enough pages to hide some { //close to beginning; only hide later pages if(($page/$per_page) < 1 + ($adjacents * 2)) { $i = 0; for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++) { if ($i == $page){ echo " <a href='search.php?search=$search&submit=Search+source+code&page=$i'><b>$counter</b></a> "; } else { echo " <a href='search.php?search=$search&submit=Search+source+code&page=$i'>$counter</a> "; } $i = $i + $per_page; } } //in middle; hide some front and some back elseif($max_pages - ($adjacents * 2) > ($page / $per_page) && ($page / $per_page) > ($adjacents * 2)) { echo " <a href='search.php?search=$search&submit=Search+source+code&page=0'>1</a> "; echo " <a href='search.php?search=$search&submit=Search+source+code&page=$per_page'>2</a> .... "; $i = $page; for ($counter = ($page/$per_page)+1; $counter < ($page / $per_page) + $adjacents + 2; $counter++) { if ($i == $page){ echo " <a href='search.php?search=$search&submit=Search+source+code&page=$i'><b>$counter</b></a> "; } else { echo " <a href='search.php?search=$search&submit=Search+source+code&page=$i'>$counter</a> "; } $i = $i + $per_page; } } //close to end; only hide early pages else { echo " <a href='search.php?search=$search&submit=Search+source+code&page=0'>1</a> "; echo " <a href='search.php?search=$search&submit=Search+source+code&page=$per_page'>2</a> .... "; $i = $page; for ($counter = ($page / $per_page) + 1; $counter <= $max_pages; $counter++) { if ($i == $page){ echo " <a href='search.php?search=$search&submit=Search+source+code&page=$i'><b>$counter</b></a> "; } else { echo " <a href='search.php?search=$search&submit=Search+source+code&page=$i'>$counter</a> "; } $i = $i + $per_page; } } } //next button if (!($page >=$foundnum-$per_page)) echo " <a href='search.php?search=$search&submit=Search+source+code&page=$next'>Next</a> "; } echo "</center>"; } } ?> Thank`s in advance.
  2. Hi all, I am working on a project where I am creating a travel agency website. At the moment I am trying to get my search engine to get the details and show the result into next page, but nothing is working. can anyone please help? thanks in advance. sorry for my messy code as I AM VERY NEW TO PHP Here are my codes for the form on index.php <form id="search" Name ="sEngine" Method ="POST" ACTION ="search.php" style="background-image:url(images/background.jpg)"> <h2>Search Flights</h2> <fieldset> <input type = "radio" name = "type" id = "return" value = "yes" checked = "checked" /> <label for = "return">Return</label> <input type = "radio" name = "type" id = "single" value = "no" /> <label for = "single">Single</label> </fieldset> <fieldset id="des"> <ul> <li> <label for="depAirport">Deperture airport</label> <input type="text" id="depAirport" name="depAirport" placeholder="Type destination airport" required autofocus> </li> <li> <label for="arrAirport">Arrival airport</label> <input type="text" id="arrAirport" name="arrAirport" placeholder="Type arrival airport" required> </li> <li> <label for="dDate">Departure date</label> <input type="date" id="dDate" name="dDate" required> </li> <li> <label for="rdate">Return date</label> <input type="date" id="rDate" name="rDate" required> </li> </ul> </fieldset> <fieldset> <label for="adult" style="margin-left:10px;">Adult</label> <input type="number" id="adult" name="adult" min="1" max="20"> <label for="child" style="margin-left:8px;">Child </label> <input type="number" id="child" name="child" min="0" max="10"> <label for="infants" style="margin-left:8px;">Infants </label> <input type="number" id="infants" name="infants" min="0" max="10"> </fieldset> <fieldset> <label for="clsType" style="margin-left:80px;">Class type</label> <select id = "myList" name="myList"> <option value = "1" selected="selected">Economy</option> <option value = "2">Premium Economy</option> <option value = "3">Business</option> <option value = "4">First</option> </select> </fieldset> <br/> <button type= "submit" onclick="myfunc()">Search Now!</button> </form> Here are my codes for search.php <?php mysql_connect("localhost", "root", "masnobi");mysql_select_db("airline_database"); ?> <?php function clean($str) { $str = @trim($str); if(get_magic_quotes_gpc()) { $str = stripslashes($str); } return mysql_real_escape_string($str); } $name=mysql_real_escape_string($_POST['depAirport']); //This value has to be the same as in the HTML form file $email=mysql_real_escape_string($_POST['arrAirport']); //This value has to be the same as in the HTML form file $sql= "SELECT * from 'flight' WHERE (departure_airport ='$depAirport' , arrival_airport = '$arrAirport', departure_date ='$dDate')"; echo "<table id='box' border='1' cellpadding='2' summary='Table holds flight information'> <tr> <th>flight_id</th> <th>flight_no</th> <th>departure_airport</th> <th>arrival_airport</th> <th>departure_date</th> <th>arrival_date</th> <th>flight_price</th> <th>flight_duration</th> <th>flight_name</th> </tr>"; while ($row = mysql_fetch_array($result)) {echo "<tr>"; echo "<td>" . $row['flight_id'] . "</td>"; echo "<td>" . $row['flight_no'] . "</td>"; echo "<td>" . $row['departure_airport'] . "</td>"; echo "<td>" . $row['arrival_airport'] . "</td>"; echo "<td>" . $row['departure_date'] . "</td>"; echo "<td>" . $row['arrival_date'] . "</td>"; echo "<td>" . '£' . $row['flight_price'] . "</td>"; echo "<td>" . $row['flight_duration'] . "</td>"; echo "<td>" . $row['flight_name'] . "</td>"; echo "</tr>"; } ?>
  3. Hi Im new here.. Im a PHP noo-b i have this simple code with sorting and pagination with dummy data (firstname,lastname,age) I would like to add some simple search to it..im not sure if im doing this right currentlty the search is not working properly for testing purpose, right now i limit 3 records per page a. when i search record and search result is display..Pagination link is still display even i have only 1record search result b. if i have 4 records found, when i click the 2nd page, the search result is gone and table is back to default view c. in table default view, clicking 2nd page and try to search record, records are not found because its looking under the 2nd page and not all of the table sorry for my English <!doctype html public "-//w3c//dtd html 3.2//en"> <html> <head> <title>Paging</title> </head> <body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000"> <form method="post" action="" > <br />Search <input type="text" name="search" /> <input type="submit" value="Search"/></form><br /> <?php require "connect.php"; // All database details will be included here // define values the rest of the code uses $table = 'person'; // database table name $sorts = array('firstname'=>'First Name','lastname'=>'Last Name','age'=>'Age'); // list of permissible sort choices $sort_bys = array('asc','desc'); // list of permissible order by choices $limit = 3; // No of records to be shown per page. // condition inputs/set default values $start = (isset($_GET['start'])) ? (int)$_GET['start'] : 0; // default to starting row 0 if not specified $sort = (isset($_GET['sort'])) ? $_GET['sort'] : 'firstname'; // default to firstname if not specified $sort_by = (isset($_GET['sort_by'])) ? $_GET['sort_by'] : 'asc'; // default to asc if not specified // validate sort input (used as a keyword in query statement) if(!array_key_exists($sort,$sorts)){ $sort = 'firstname'; // default to firstname } // validate sort_by input (used as a keyword in query statement) if(!in_array($sort_by,$sort_bys)){ $sort_by = 'asc'; // default to asc } $eu = $start; $this1 = $eu + $limit; $back = $eu - $limit; $next = $eu + $limit; // get opposite sort_by value for producing toggle links in the table heading (only) if($sort_by == 'asc'){ $sort_order = 'desc'; } else { $sort_order = 'asc'; } /////////////// WE have to find out the number of records in our table. We will use this to break the pages/////// $query="SELECT COUNT(*) FROM $table"; $result=mysql_query($query); //echo $query, mysql_error(); list($nume) = mysql_fetch_row($result); /////// The variable nume above will store the total number of records in the table//// /////////// Now let us print the table headers //////////////// $bgcolor="#f1f1f1"; echo "<table border='1'>" ; echo "<tr> <th>ID</th>"; // dynamically produce choices/columns foreach($sorts as $key=>$value){ echo "<th><a href='?sort=$key&sort_by=$sort_order'>$value</a></th>"; } echo "</tr>"; ////////////// Now let us start executing the query with variables $eu and $limit set at the top of the page/////////// //$query="SELECT * FROM $table ORDER BY $sort $sort_by limit $eu, $limit"; $query="SELECT * FROM $table where firstname like '%" . $_POST['search'] . "%' or lastname like '%" . $_POST['search'] . "%' or age like '%" . $_POST['search'] . "%' ORDER BY $sort $sort_by limit $eu, $limit"; $result=mysql_query($query); //echo $query, mysql_error(); $count = (isset($eu) && $eu > 0) ? $eu+1 : 1; //////////////// Now we will display the returned records in side the rows of the table///////// while($rows = mysql_fetch_array($result)){ // toggle bgcolor if($bgcolor=='#f1f1f1'){$bgcolor='#ffffff';} else{$bgcolor='#f1f1f1';} echo "<tr >"; echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>"; echo $count++; echo "</font></td>"; echo "<td>$rows[firstname]</td>"; echo "<td>$rows[lastname]</td>"; echo "<td>$rows[age]</td>"; echo "</tr>"; } echo "</table>"; ////////////////////////////// End of displaying the table with records //////////////////////// /////////////////////////////// if($nume > $limit ){ // Let us display bottom links if sufficient records are there for paging /////////////// Start the bottom links with Prev and next link with page numbers ///////////////// echo "<table align = 'center' width='50%'><tr><td align='left' width='30%'>"; //// if our variable $back is equal to 0 or more then only we will display the link to move back //////// if($back >=0){ $_GET['start'] = $back; // only modify the 'start' value, all others left as is $q = http_build_query($_GET,'','&'); print "<a href='?$q'><font face='Verdana' size='2'>PREV</font></a>"; } //////////////// Let us display the page links at center. We will not display the current page as a link /////////// echo "</td><td align=center width='30%'>"; $i=0; $l=1; for($i=0;$i < $nume;$i=$i+$limit){ if($i <> $eu){ $_GET['start'] = $i; // only modify the 'start' value, all others left as is $q = http_build_query($_GET,'','&'); echo " <a href='?$q'><font face='Verdana' size='2'>$l</font></a> "; } else { echo "<font face='Verdana' size='4' color=red>$l</font>";} /// Current page is not displayed as link and given font color red $l=$l+1; } echo "</td><td align='right' width='30%'>"; ///////////// If we are not in the last page then Next link will be displayed. Here we check that ///// if($this1 < $nume){ $_GET['start'] = $next; // only modify the 'start' value, all others left as is $q = http_build_query($_GET,'','&'); print "<a href='?$q'><font face='Verdana' size='2'>NEXT</font></a>"; } echo "</td></tr></table>"; }// end of if checking sufficient records are there to display bottom navigational link. include "menu.php"; ?>
  4. hello all of you. i have database name Products id pr_name good poor faulty i need auto complete search that they suggest (pr_name) from my phpmyadmin database. this is my search code: <div id="wb_Form2" style="position:absolute;width:483px;height:112px;"> <form name="search" method="get" action="db1.php" id="Form2" onsubmit="return Validatesearch(this)"> <input type="text" id="Editbox8" style="position:absolute;left:11px;top:17px;width:456px;height:38px;line-height:38px;z-index:2;" name="query" value="" autocomplete="off" input type="text" name="query"> <input type="submit" id="Button3" name="" value="Add" style="position:absolute;left:192px;top:71px;width:96px;height:37px;z-index:3;"> </form> </div> and this is my search code: <html> <body> <head> <font size="3"><strong> <?php // Connects to your Database mysql_connect("host", "user", "pass") or die(mysql_error()); mysql_select_db("table") or die(mysql_error()); $q = mysql_real_escape_string($_GET['query']); $data = mysql_query("SELECT * FROM Products where name LIKE '%$q%'") or die(mysql_error()); while($info = mysql_fetch_array( $data )) { echo "Product Name: $info[name]<br>"; echo "Good Price: $info[good]<br>"; echo "Poor Price: $info[poor]<br>"; echo "Faculty Price: $info[faulty]<br><br>"; } ?>
  5. I am using two tables. "Landlord Table" is a 2 column table. column 1 = "Landlord name" and column 2 ="buildings". "buildings" are set as a primary key. All data from this table is displayed under "Landlord Table" on bottom of page at: http://responsiblyvodka.com/tester.php Problem: I want to add available apartments into a NEW table for potential renters. Instead of searching through all the buildings like I currently have at top in the second combobox. I want to click the landlord name i.e. "ABC" and only have 3 building addresses show up in the combo next to it.
  6. I apologize in advance for my utter noobness. I've been learning php in bits and pieces. My database structure: 3 fields only, the relevant ones being "artist" and "title" I made a search page (POETS Karaoke songs) that searches correctly, but only if the user inputs partial or complete words in the correct order, and the words only appear in one of the two fields. I wanted to make it possible to find artist/title combination when multiple or partial words are input in any order. I did something wrong, in that my new coding returns the database regardless of the search terms. This broken page is here. <form name="search" method="post" action="<?=$PHP_SELF?>"> <span> <input type="text" name="find" /> <input type="hidden" name="searching" value="yes" /> <input type="submit" name="search" value="Search" /> </span> </form> <? //This is only displayed if they have submitted the form if ($searching =="yes") { echo "<br><b>You searched for: " .$find; echo "<hr>"; //If they did not enter a search term we give them an error if ($find == "") { echo "<p>No search term entered. Please go back to the previous page and try again."; exit; } // Begin Search $searchQuery = ''; // search query is empty by default $searchCondition = "(artist LIKE '%%' OR title LIKE '%%')"; $searchFieldName = 'artist'; // name of the field to be searched $searchFieldName2 = 'title'; if(isset($find['text'])) { // check if a query was submitted $searchQuery = trim($find['text']); // getting rid of unnecessary white space $searchTerms = explode(" ", $searchQuery); // Split the words $searchCondition = "($searchFieldName LIKE '%" . implode("%' OR $searchFieldName LIKE '%", $searchTerms) . "%')"; // Forming the condition for the sql $searchCondition .= " OR ($searchFieldName2 LIKE '%" . implode("%' OR $searchFieldName2 LIKE '%", $searchTerms) . "%')"; } // End Search $sql = "SELECT * FROM songs WHERE $searchCondition;"; // the rest is just database connection and retrieving the results $dblink = mysql_connect("poetskaraokecom.ipagemysql.com", "poets", "guest"); mysql_select_db("poets_songs", $dblink); $result = mysql_query($sql, $dblink); echo "<ol>"; // Capture the result in an array, and loop through the array while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { printf("<li>%s<font color='grey'> ... </font><i>%s</i></li>", $row[artist], $row[title]); } echo "</ol>"; //This counts the number or results - and if there wasn't any it gives them a little message explaining that $anymatches=mysql_num_rows($result); if ($anymatches == 0) { echo "No entries matched your query<br><br>"; } } ?> I haven't been able to determine whether my error is in my query of the database, or if it's in the return of the results. Any help would be much appreciated. Thanks, Cindy
  7. Hi phpFreaks! To improve my php skills I do some private coding for my own. I did some small php scripts in the past, however never worked with the "search/DB" topic. This is where someone may help me a bit to give me a good start for my next project: "A scrabble search engine based on a dictionary with php & mysql" I'll try to do this as most efficient (fast) as possible. Requirements: > "field to enter random 1-14 letters" to search for words in the DB > "Dictionary in Database" or in file but I dont think that may be faster... My plan: > Put every single word into a database table called "words" (EDIT: maybe I should add a second row and save the "word length" of each word as well) > split up the 1-14 letters into a letter array > build a loop which groups the 1-14 letterArray together in all possible combinations: > 1st run: two-party groups -> check with "like" if its in the database for every single entry and put the result in a resultArray (EDIT: only check the words with the "word length" = 2) > 2nd run: three-party groups -> check with "like" if its in the database for every single entry and attach the result to the resultArray (EDIT: only check the words with the "word length" = 3) .....>14th run... > output resultArray I'm not looking for code parts, I'm just looking for a good concept to start with. Does someone have any recommendations on how I could do it better than the above? In my eyes there are too many DB search requests and maybe there is a better way to do it? Cheers Mike
  8. Hi, I'm new to this site. I'm having problems with the basic search on my site is too specific.. Meaning it's too exact with word order and phrases. For example, if I search Shoes Red it won't show results for Red Shoes. If you search for Red Shoe Laces it won't show results for Red Laces (as the word shoe throws off this order). Below is the code that I believe the search box is using. Can anyone tell me how to "loosen" up this search so it's either more broad or so exact word order isn't necessary? This is the current code: case 'search': if (intval($filter) != 0) { $filter = JString::strtolower($filter); $id = intval($filter); $search .= $temp."(a.id = $id OR LOWER(a.ad_headline) LIKE '%".$this->_db->getEscaped($filter,true)."%' OR LOWER(a.ad_text) LIKE '%".$this->_db->getEscaped($filter,true)."%')"; } else { $filter = JString::strtolower($filter); $search .= $temp."(LOWER(a.ad_headline) LIKE '%".$this->_db->getEscaped($filter,true)."%' OR LOWER(a.ad_text) LIKE '%".$this->_db->getEscaped($filter,true)."%')"; } break; } } } return $search; } Any ideas here?
  9. I have a website that runs on WordPress / PHP & MYSQL Database. I was hoping to build a search form that will access my database and grab result to display in a separate page. Any help would be greatly appreciated. Thank you!
  10. Hi I am working with search form in php. I want my search button to work with autocomplete for three search bars. Kindly guide me with the coding for the search button to get connected with the result displaying. Please find attached my header file. The autocomplete is working, fetching the values from the database but I want - when we click on search button it should display the result. Thanks in advance. Expecting the reply from you soon.header.php
  11. I'll state that I'm a complete amateur when it comes to programming in case I'm not clear or I say something that doesn't make sense. I have two websites which have evolved over the years with different programmers at different times - www.little-persia.com and www.love-rugs.com. I look after both cosmetically and have worked out various issues with javascript, php etc. over the years by just researching and teaching myself/using common sense/problem solving. However I'm stumped. Little-Persia is really fast when it comes to searches (page changes in under 2 seonds and images load within another second) yet Love-Rugs is unbearably slow (I hit search and the page hangs for about 12 seconds before doing anything). I think I've worked it out as having little to do with page sizes/image load times etc. and more to do with number of queries. Load times are at their worst for a blank search - if I put in a few filters in an advances search the load times become bearable (although still not great or anywhere near the same speed as Little-Persia). The two websites have different tables with Love-Rugs loading information on stock levels/size and price from one and general details from another. Little-Persia is all individual products (don't come in a variety of sizes/prices) so all their info is stored on one table. I'm trying to obviously figure out how to speed it up and/or remove unnecessary queries but to do that I need to find out where they're originating. Is there a way to do this?
  12. So basically I have a HUGE text file; download here or the code is like this; FirstName: Wayne, LastName: Brown, CommonName:None, Height: 185, DateOfBirth: Year: 1977, Month: 1, Day: 14, PreferredFoot: Right, ClubId: 1951, LeagueId: 61, NationId: 14, Rating: 54, Attribute1: 56, Attribute2: 53, Attribute3: 47, Attribute4: 61, Attribute5: 36, Attribute6: 49, Rare: 0, ItemType: PlayerGk but this is repeated like 11,480 times(to be exact) but with different information e.g names ect. I have the search working ATM like this; <?php $search = 'Wayne'; $lines = file('cleanedfutplayers.txt'); $found = false; foreach($lines as $line) { if(strpos($line, $search) !== false) { $found = true; echo $line; } } if(!$found) { echo "<i>No match found"; } ?> And atm I get a return of this; BUT i want to filter it out. I want it to just take the values such as getting the value of first name would just get Wayne and the same for the rest of the fields. and i also need some <br> 's in there and some spacing. So how would I go about filtering this? Also how would I add a search box and a button that would give and set the value of the; $search = ''; so for example i THINK the code will be something like this; echo "First Name: ", ['FirstName']; but it isnt because ive tested and it doesnt work? so PLEASE help me!
  13. This is the first part of the search script and i was doing some debuging and i cant figure out why this code if( !($fd = fopen($url,"r")) ){ die( "Could not open URL!" ); } while( $buf = fgets($fd,1024) ) { /* Remove whitespace from beginning and end of string: */ $buf = trim($buf); /* Try to remove all HTML-tags: */ $buf = strip_tags($buf); $buf = preg_replace('/&\w;/', '', $buf); /* Extract all words matching the regexp from the current line: */ preg_match_all("/(\b[\w+]+\b)/",$buf,$words); print_r($words); } doubles each associate array like this Array ( [0] => Array ( ) [1] => Array ( ) ) Array ( [0] => Array ( [0] => It [1] = > was [2] => November ) [1] => Array ( [0] => It [1] = > was [2] => November ) ) When I would expect this Array ( [0] => Array ( ) ) Array ( [0] => Array ( [0] => It [1] = > was [2] => November ) )
  14. hello Php Freaks, i have manage to make a search box and view the student name listed on the database with a link VIEW, EDIT, DELETE on the left side. My problem is i wanted that when i click the VIEW it must direct to a specific student which name appeared on the right side. This is my ajax.php code. $display_string = "<table border='1' cellpadding='10' cellspacing='1' align='center'>"; $display_string .= "<tr align='center'>"; $display_string .= "<th>LR Number</th>"; $display_string .= "<th>F i r s t N a m e</th>"; $display_string .= "<th>L a s t N a m e</th>"; $display_string .= "<th>Grade</th>"; $display_string .= "<th>Section</th>"; $display_string .= "<th>View</th>"; $display_string .= "<th>Update</th>"; $display_string .= "<th>Delete</th>"; $display_string .= "</tr>"; // Insert a new row in the table for each person returned while($row = mysql_fetch_array($qry_result)){ $display_string .= "<tr>"; $display_string .= "<td>$row[LRN]</td>"; $display_string .= "<td>$row[first_name]</td>"; $display_string .= "<td>$row[last_name]</td>"; $display_string .= "<td>$row[grade]</td>"; $display_string .= "<td>$row[section]</td>"; $display_string .= "<td><a href='View_Profile.php?userID=$row[student_id]'>View</a> </td>"; $display_string .= "<td><a href='Admin_Edit_Student_Info.php?userID=$row[student_id]''>Update</a></td>"; $display_string .= "<td><a href='Admin_Delete_Student.php?userID=$row[student_id]''>Delete</a></td>"; $display_string .= "</tr>"; and this is the Student_home.php <p align="left"> </p> <p align="left"><span class="stylebig">LEARNERS INFORMATION</span></p> </blockquote> <table width="85%" align="center"> <tr class="stylesmall"> <td height="50" align="left" valign="middle" class="style3 style8"> LRN</td> <td align="left" valign="middle" class="style8"> </td> <td align="left" valign="middle" class="style8"> </td> <td class="style8"> </td> </tr> <tr class="stylesmall"> <td width="142" height="50" align="left" valign="middle" class="style8">First Name</td> <td width="177" align="left" valign="middle" class="style8"> </td> <td width="151" align="left" valign="middle" class="style8">Last Name</td> <td width="159" class="style8"> </td> </tr> <tr class="stylesmall"> <td width="142" height="50" align="left" valign="middle" class="style8">Gender</td> <td align="left" valign="middle" class="style8"> </td> <td align="left" valign="middle" class="style8">Date Of Birth</td> <td class="style8"> </td> </tr> <tr class="stylesmall"> <td width="142" height="50" align="left" valign="middle" class="style8">Grade</td> <td align="left" valign="middle" class="style8"> <td align="left" valign="middle" class="style8">Contact No</td> <td class="style8"> </td> </tr> <tr class="stylesmall"> <td width="142" height="50" align="left" valign="middle" class="style8">Primary Email</td> <td align="left" valign="middle" class="style8"> </td> <td align="left" valign="middle" class="style8">Secondary Email</td> <td class="style8"> </td> </tr> <tr align="left" valign="middle" class="stylesmall"> <td width="142" height="50" class="style8">Address</td> <td class="style8"> <tr align="left" valign="middle" class="stylesmall"> <td width="142" height="50" class="style8">Description</td> <td class="style8"> <td class="style8"></td > </tr > </table> </div> i think i miss some lines of codes in the target page (Student_home.php). Please i am a newly practicing php coder. Help me clarify lines which i have mistaken and how to replace/correct/insert on the proper place. God bless everyone,
×
×
  • 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.