PHP - How To Search Data In Xls Sheet From Search Options
Hello All,
Similar TutorialsHi I have this serach function, wich searches on site by a lot of parameters at the same time (titolo, titolo2, attore1,etc...) , but I want to make them options, so you would have a search field and an options dropdown menu. Can anyone help me with this? My code follows: PHP Code: [Select] function jm_search(){ global $database, $sstring, $my, $cinConfig, $Itemid, $option, $mainframe; $tl_title = _JMOVIES_SEARCHRESULT." ".$sstring; $suchstring = trim( strtolower( $sstring ) ); $query1 = "SELECT * FROM #__jmovies WHERE" ."\n (titolo LIKE '%".$suchstring."%'" ."\n OR titolo2 LIKE '%".$suchstring."%'" ."\n OR attore1 LIKE '%".$suchstring."%'" ."\n OR attore2 LIKE '%".$suchstring."%'" ."\n OR attore3 LIKE '%".$suchstring."%'" ."\n OR attore4 LIKE '%".$suchstring."%'" ."\n OR nazione LIKE '%".$suchstring."%'" ."\n OR regista LIKE '%".$suchstring."%'" ."\n OR descrizione LIKE '%".$suchstring."%'" ."\n OR anno LIKE '%".$suchstring."%') AND published = 1 AND access <= ".(int)$my->gid." ORDER BY titolo"; $database->setQuery($query1); //echo $database->getQuery(); $rows = $database->loadObjectList(); if(is_file($mainframe->getCfg('absolute_path')."/components/".$option."/templates/".$cinConfig['template']."/show_search_tpl.php")) require($mainframe->getCfg('absolute_path')."/components/".$option."/templates/".$cinConfig['template']."/show_search_tpl.php"); else require($mainframe->getCfg('absolute_path')."/components/".$option."/templates/default/show_search_tpl.php"); } HTML Code: [Select] <td width="44%" valign="middle" bgcolor="#eeeeee" style="text-align:right"> <input name="sstring" type="text" class="jmoviesInputSearch" title="<?php echo _JMOVIES_SEARCH?>" onfocus="if(this.value=='<?php echo _JMOVIES_SEARCH?>') this.value='';" onblur="if(this.value=='') this.value='<?php echo _JMOVIES_SEARCH?>';" onchange="javascript:document.jmoviesSearchForm.submit();" value="<?php echo _JMOVIES_SEARCH?>" size="50"/><input type="submit" value="OK" class="button"/></td> Thank you. Hello PHPFreaks, I am busy with creating a search script that will search the database. I got it working so far but i want it to search for not only one thing but several things so actually make options in the form that you you choose only to search on name or only on address. How do i do this? The PHP code: Code: [Select] <?php mysql_connect ("localhost", "username","password") or die (mysql_error()); mysql_select_db ("database table"); $term = $_POST['term']; $sql = mysql_query("select * from databasetable where naam like '%$term%'"); while ($row = mysql_fetch_array($sql)){ echo "<center>"; echo "<table width='600px'>"; echo "<tr>"; echo "<td><b>Naam:</b> </td><td>".$row['naam']; echo "</td><td><b>Telefoon:</b> </td><td>".$row['telefoon']; echo "</td></tr><tr>"; echo "<tr>"; echo "<td><b>Adres:</b> </td><td>".$row['adres']; echo "</td><td><b>Mobiel:</b> </td><td>".$row['mobiel']; echo "</td></tr><tr>"; echo "<tr>"; echo "<td><b>Postcode:</b> </td><td>".$row['postcode']; echo "</td><td><b>E-mail:</b> </td><td>".$row['email']; echo "</td></tr><tr>"; echo "<tr>"; echo "<td><b>Woonplaats:</b> </td><td>".$row['woonplaats']; echo "</td></tr>"; echo "</table>"; echo "<br /><br />"; echo "<table width='400px'>"; echo "<tr>"; echo "<td><b>Datum:</b> </td><td>".$row['datum']; echo "</td></tr><tr><td><b>Probleem:</b> </td><td>".$row['probleem']; echo "</td></tr><tr>"; echo "<td><b>Mogelijke oplossing:</b> </td><td>".$row['oplossing1']; echo "</td></tr><tr><td><b>Oplossing:</b> </td><td>".$row['oplossing2']; echo "</td></tr><tr>"; echo "<td><b>Wachtwoord:</b> </td><td>".$row['wachtwoord']; echo "</td><tr><td><b>Geschatte Prijs:</b> </td><td>".$row['prijs']; echo "</td></tr><tr>"; echo "<td><b>Bijgeleverd:</b> </td><td>".$row['bijgeleverd']; echo "</td></tr>"; echo "</table><br />"; echo "---------------------------------------------------------------------------------------"; echo "</center>"; echo "<br/><br/>"; } ?> HTML Form: Code: [Select] <form action="search.php" method="post"> <b>RMA Zoeken:</b><br /> <input type="text" name="term" /><br /><br /> <input type="submit" class="art-button" name="submit" value="Submit" /> </form> The result pages is supposed to have pagination like google help me please
I require a page to be added to my website. This page will facilitate a refined search via Google, Bing and Yahoo search engine simultaneously , show the top 5 of each engine. Is this possible using php ? Thank's Hello, Does anyone know a tutorial I can follow to create my own search engine over the items I have in my SQL database? I find a lot of tutorials but they are all 'one word searches' which means if you type two words you will get all results that contain either word (too many hits). If the search engine tutorial displays result with AJAX even better. Thanks for help. df Friends, I want to extract the Search Keyword from the URL, a visitor came from. I am using a PHP CMS and want to show the Keyword on my Blog. So if they search "abcd" from google, i want to extract "abcd" and echo on my blog. Here is the coding i could got hold of, but its not working, not echoing anything <?php function pk_stt2_function_get_delimiter($ref) { $search_engines = array('google.com' => 'q', 'go.google.com' => 'q', 'images.google.com' => 'q', 'video.google.com' => 'q', 'news.google.com' => 'q', 'blogsearch.google.com' => 'q', 'maps.google.com' => 'q', 'local.google.com' => 'q', 'search.yahoo.com' => 'p', 'search.msn.com' => 'q', 'bing.com' => 'q', 'msxml.excite.com' => 'qkw', 'search.lycos.com' => 'query', 'alltheweb.com' => 'q', 'search.aol.com' => 'query', 'search.iwon.com' => 'searchfor', 'ask.com' => 'q', 'ask.co.uk' => 'ask', 'search.cometsystems.com' => 'qry', 'hotbot.com' => 'query', 'overture.com' => 'Keywords', 'metacrawler.com' => 'qkw', 'search.netscape.com' => 'query', 'looksmart.com' => 'key', 'dpxml.webcrawler.com' => 'qkw', 'search.earthlink.net' => 'q', 'search.viewpoint.com' => 'k', 'mamma.com' => 'query'); $delim = false; if (isset($search_engines[$ref])) { $delim = $search_engines[$ref]; } else { if (strpos('ref:'.$ref,'google')) $delim = "q"; elseif (strpos('ref:'.$ref,'search.atomz.')) $delim = "sp-q"; elseif (strpos('ref:'.$ref,'search.msn.')) $delim = "q"; elseif (strpos('ref:'.$ref,'search.yahoo.')) $delim = "p"; elseif (preg_match('/home\.bellsouth\.net\/s\/s\.dll/i', $ref)) $delim = "bellsouth"; } return $delim; } /** * retrieve the search terms from search engine query * */ function pk_stt2_function_get_terms($d) { $terms = null; $query_array = array(); $query_terms = null; $query = explode($d.'=', $_SERVER['HTTP_REFERER']); $query = explode('&', $query[1]); $query = urldecode($query[0]); $query = str_replace("'", '', $query); $query = str_replace('"', '', $query); $query_array = preg_split('/[\s,\+\.]+/',$query); $query_terms = implode(' ', $query_array); $terms = htmlspecialchars(urldecode(trim($query_terms))); return $terms; } /** * get the referer * */ function pk_stt2_function_get_referer() { if (!isset($_SERVER['HTTP_REFERER']) || ($_SERVER['HTTP_REFERER'] == '')) return false; $referer_info = parse_url($_SERVER['HTTP_REFERER']); $referer = $referer_info['host']; if(substr($referer, 0, 4) == 'www.') $referer = substr($referer, 4); return $referer; } $referer = pk_stt2_function_get_referer(); if (!$referer) return false; $delimiter = pk_stt2_function_get_delimiter($referer); if( $delimiter ){ $term = pk_stt2_function_get_terms($delimiter); } echo $term; ?> May someone help? Natasha T Hello, I'm developing a website that asks the user to submit a keyword for a search. The results should display matches for this keyword, but also show matches for related keywords (in order of relevenace!). I'm planning on building up a library of which search terms users use in the same sessions (e.g. if someone searches for "it jobs" and "php jobs", I'll know the terms are correlated), and I'll also measure the click-through rates of the items on the results list. I've been spending all weekend trying to map out the design for this but it's proving incredibly complicated and I think the solution is likely to be on the internet somewhere already?! Please could someone point me in the right direction if you've come accross this problem before? Thanks a million, Stu I am developing a intranet forum in Php and MySQL and I am using ajax to display searched results on the same page but right now I am using query LIKE text% to search in database which is slower. but I want to make it fast search engin which can parse *,+ and show result. Since I am using ajax i am not able to use free search engin,so if possible pls provide a complete solution I have code to search a database of members, I can search by lastname but having a little problem. I want to be able to search by lastname starting with the first letter. (ie: a or b or c or d and so on). As it is right now I can only search by first letter of last name if I add % to the search (ie: a% b% c%) will give me all members with the last names starting with the approiate letter designation. I'm not sure how to handle this, any help would be appreciated. Thanks. Code: [Select] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> </head> <body> <center><table cellspacing="10" cellpadding="10" width="750" border="0"> <h4>Search</h4> <form name="search" method="post" action="<?php $PHP_SELF?>"> Seach for: <input type="text" name="find" /> in <Select NAME="field"> <Option VALUE="lname">Last Name</option> <input type="hidden" name="searching" value="yes" /> <input type="submit" name="search" value="Search" /> </form> <?php // check to see if anything is posted if (isset($_POST['find'])) {$find = $_POST['find'];} if (isset($_POST['searching'])) {$searching = $_POST['searching'];} if (isset($_POST['field'])) {$field = $_POST['field'];} //This is only displayed if they have submitted the form if (isset($searching) && $searching=="yes") { echo "<h4>Results</h4><p>"; // If they did not enter a search term we give them an error if (empty($find)) { echo "<p>You forgot to enter a search term"; exit; } // Otherwise we connect to our Database mysql_connect("localhost", "root", "1910") or die(mysql_error()); mysql_select_db("cmc_member") or die(mysql_error()); // We preform a bit of filtering $find = strtoupper($find); $find = strip_tags($find); $find = trim ($find); // Now we search for our search term, in the field the user specified $results = mysql_query("SELECT * FROM members WHERE upper($field) LIKE'$find'"); // And we display the results if($results && mysql_num_rows($results) > 0) { $i = 0; $max_columns = 3; while($row = mysql_fetch_array($results)) { // make the variables easy to deal with extract($row); // open row if counter is zero if($i == 0) echo "<tr>"; // make sure we have a valid product ALIGN='CENTER' if($fname != "" && $fname != null) echo "<td ALIGN='CENTER'><FONT COLOR='red'><b>$fname $lname</b></FONT><br> $address <br> $city $state $zip <br>$phone<br><a href=\"mailto: $email\">$email</a><br></td>"; // increment counter - if counter = max columns, reset counter and close row if(++$i == $max_columns) { echo "</tr>"; $i=0; } // end if } // end while } // end if results // clean up table - makes your code valid! if($i < $max_columns) { for($j=$i; $j<$max_columns;$j++) echo "<td> </td>"; } //This counts the number or results - and if there wasn't any it gives them a little message explaining that $anymatches = mysql_num_rows($results); if ($anymatches == 0) { echo "Sorry, but we can not find an entry to match your query<br><br>"; } //And we remind them what they searched for echo "<b>Searched For:</b> " .$find; } ?> </tr> </table></center> </body> </html> Hi all How do I modify the below code to search multiple tables in mySQL database? $query = "select * from store_items where description like \"%$trimmed%\" or title like \"%$trimmed%\" or dimensions like \"%$trimmed%\" order by id ASC"; $numresults=mysql_query($query); $numrows=mysql_num_rows($numresults); It is for a search function and I need it to search another table called 'about_text' and 'faq_text' Thanks Pete Hello. I am working on a php script for searching a database table. I am really new to this, so I used the this tutorial http://www.phpfreaks.com/tutorial/simple-sql-search I managed to get all the things working the way I wanted, except one important and crucial thing. Let me explain. My table consist of three columns, like this: ID(bigint20) title(text) link (varchar255) ============================= ID1 title1 link-1 ID2 title2 link-2 etc... Like I said, I managed to make the script display results for a search query based on the title. Want I want it to do more, but I can't seem to find the right resource to learn how, is to place a "Download" button under each search result with its corresponding link from the table. Here is the code I used. <?php $dbHost = 'localhost'; // localhost will be used in most cases // set these to your mysql database username and password. $dbUser = 'user'; $dbPass = 'pass'; $dbDatabase = 'db'; // the database you put the table into. $con = mysql_connect($dbHost, $dbUser, $dbPass) or trigger_error("Failed to connect to MySQL Server. Error: " . mysql_error()); mysql_select_db($dbDatabase) or trigger_error("Failed to connect to database {$dbDatabase}. Error: " . mysql_error()); // Set up our error check and result check array $error = array(); $results = array(); // First check if a form was submitted. // Since this is a search we will use $_GET if (isset($_GET['search'])) { $searchTerms = trim($_GET['search']); $searchTerms = strip_tags($searchTerms); // remove any html/javascript. if (strlen($searchTerms) < 3) { $error[] = "Search terms must be longer than 3 characters."; }else { $searchTermDB = mysql_real_escape_string($searchTerms); // prevent sql injection. } // If there are no errors, lets get the search going. if (count($error) < 1) { $searchSQL = "SELECT title, link FROM db WHERE title LIKE '%{$searchTermDB}%'"; $searchResult = mysql_query($searchSQL) or trigger_error("There was an error.<br/>" . mysql_error() . "<br />SQL Was: {$searchSQL}"); if (mysql_num_rows($searchResult) < 1) { $error[] = "The search term provided {$searchTerms} yielded no results."; }else { $results = array(); // the result array $i = 1; while ($row = mysql_fetch_assoc($searchResult)) { $results[] = "{$row['title']}<br /> Download - this is the button I want to link to the title results - and maybe other links too - <br /> "; $i++; } } } } function removeEmpty($var) { return (!empty($var)); } ?> <?php echo (count($error) > 0)?"The following had errors:<br /><span id=\"error\">" . implode("<br />", $error) . "</span><br /><br />":""; ?> <form method="GET" action="search?" name="searchForm"> Search for title: <input type="text" name="search" value="<?php echo isset($searchTerms)?htmlspecialchars($searchTerms):''; ?>" /> <input type="submit" name="submit" value="Search" /> </form> <?php echo (count($results) > 0)?"Rezultate lucrari de licenta sau disertatie pentru {$searchTerms} :<br /><br />" . implode("", $results):""; ?> $results = array(); // the result array $i = 1; while ($row = mysql_fetch_assoc($searchResult)) { $results[] = "{$row['title']}<br /> Download - this is the button I want to link to the title results - and maybe other links too - <br /> "; $i++; I would like the results to be displayed like this Results for SearchItem: Result 1 Download | Other link Result 2 Download | Other link etc.... or something like this. So, how do I add the data from the link row into a text(Dowload), within an <a href> tag (well, at least I guess it would go this way) ? My first tries (fueled by my lack of knowledge) where things like $results[] = "{$row['title']}<br /> <a href="{$row['link']}">Download</a> <br /> "; but I keep getting lots of errors, and then I don't know much about arrays and stuff (except basic notions); So there it is. I am really stuck and can't seem to find any workaround for this. Any suggestions? (examples, documentation, anything would do, really) Thanks, Radu i have php code, <?php include ("connect.php"); $selecteddate = $_POST['sdate']; $sql1 = "select date from game1"; $query1 = mysql_query($sql1) or die(mysql_error()); while($row = mysql_fetch_assoc($query1)) { $rowdate = $row['date']; // problem here i this while loop only compare my latest last value in database. i want a code here which search all the data in "date" field. } if($selecteddate == $rowdate) { echo "Date already Exists"; } else { // form insertion data code here which i have and working fine } SHINSTAR is online now Add to SHINSTAR's Reputation Report Post Edit/Delete Message I have made a data table out of my mySQL table and I should have a search option. Lik where you have 3 boxes on one line : Naam - Date1 - Date2 Naam is just searching results with that value You can insert Date1 and Date 2 and then it must search between those dates. But what will it do if i only put 1 date ? Like 2011-12-23 and date2 open will it then only show the dates from 2011-12-23 ? <html><body><?php$username="";$password="";$database="";mysql_connect(localhost,$username,$password);@mysql_select_db($database) or die( "Unable to select database");$query = "SELECT middenoosten2.*, users.naam ". "FROM middenoosten2, users ". "WHERE middenoosten2.speler = users.inlog order by id asc";$result=mysql_query($query);$num=mysql_numrows($result);mysql_close();?><p><b>Scores middenoosten : Zee en rivieren</b></p><table border="1" cellspacing="2" cellpadding="2"><tr><th><font face="Arial, Helvetica, sans-serif">Id</font></th><th><font face="Arial, Helvetica, sans-serif">Naam</font></th><th><font face="Arial, Helvetica, sans-serif">Score 11/...</font></th><th><font face="Arial, Helvetica, sans-serif">datum</font></th><th><font face="Arial, Helvetica, sans-serif">uur</font></th><th><font face="Arial, Helvetica, sans-serif">percent</font></th><th><font face="Arial, Helvetica, sans-serif">duur</font></th></tr><?php$i=0;while ($i < $num) {$f1=mysql_result($result,$i,"id");$f2=mysql_result($result,$i,"naam");$f3=mysql_result($result,$i,"score");$f4=mysql_result($result,$i,"datum");$f5=mysql_result($result,$i,"tijd");$f6=mysql_result($result,$i,"percent");$f7=mysql_result($result,$i,"crono");?><tr><td><font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font></td><td><font face="Arial, Helvetica, sans-serif"><?php echo $f2; ?></font></td><td><font face="Arial, Helvetica, sans-serif"><?php echo $f3; ?></font></td><td><font face="Arial, Helvetica, sans-serif"><?php echo $f4; ?></font></td><td><font face="Arial, Helvetica, sans-serif"><?php echo $f5; ?></font></td><td><font face="Arial, Helvetica, sans-serif"><?php echo $f6; ?></font></td><td><font face="Arial, Helvetica, sans-serif"><?php echo $f7; ?></font></td></tr><?php$i++;}?></body></html>() Thank you Hello, Curious to know if someone could point me in the right direction, been struggling with this for a bit now. I have a HTML page with a search field, I can enter a search term and hit the submit button and I am directed to my search.php page with the appropriate results. What I am looking to accomplish is having the search results from the search.php page displayed in a text area below my search field in my HTML page. I have included an image to better describe what I am looking to accomplish: Additionally below is the source from my HTML page and search.php page: page.html <form name="search" action='search.php' method="post"> <input type="text" class="myinputstyle" name="search" value="search" onClick="this.value=''"/><br> <input type="submit" value="submit" class="myinputstyle"> </form> search.php <?php $search = "%" . $_POST["search"] . "%"; mysql_connect ("localhost", "game_over", "Ge7Ooc9uPiedee3oos9xoh4th"); mysql_select_db ("game_over"); $query = "SELECT * FROM game_over WHERE first_name LIKE '$search'"; $result = mysql_query ($query); if ($result) { while ($row = mysql_fetch_array ($result)) { echo "Name: {$row['name']} " . "{$row['lname']} <br>" . "Email: {$row['email]} <br>" . } } ?> Any insight would be most appreciated. Thank you. This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=334273.0 Need some help I have 2 tables in a database and I need to search the first table and use the results from that search, to search another table, can this be done? and if it can how would you recommend that I go about it? Thanks For Your Help Guys! I want to know how to display results from mysql database by filling in a form. but i have found a tutorial which shows typing in a text box which displays results. if i follow this tutorial will it help me to understand and create php coding to display results for my form? Hi guys and girls Right im not directly asking for code but i am aware how to set up and make a single search in a form against a database the issue ive come across is that i was to be able for the user to search against 3 different columns in the table each with their own textbox and submit button just wonderign if i would do this on 3 different forms or if it is easy ? Thank you Hi all, I need some help from you experts! I have an internet radio station. On my playlist page I would like to have it where if a listener requests a song, that when they type in a letter example: if they type in the letter " A " it will display all the artists that start with " A" or if they type in " B " it displays all artist that starts with " B " etc. below is the code I need to make this happen and I have no clue where or what in the code I need to change to make this work.
<?php require_once('display.header.php'); ?> <!-- BEGIN:SEARCH --> <div id="search"> <form method="get" action="playlist.php" name="searchParameters"> Search: <?php InputText('search', $search, '',20); ?> <input type="submit" value="Go" name="B1" /> Display <?php InputCombo('limit', $limit, 25, '5,10,25,50,100', "", "document.forms.searchParameters.submit();"); ?> results <hr/> Search by Artist:<br /> <table> <tbody> <tr> <td> <input type="submit" name="character" class="characterButton" value="All" onclick="document.forms.searchParameters.search.value=''"/> </td> <td> <input <?php echo "0 - 9" == $character? "id='activeCharacter'" : "";?> type="submit" name="character" class="characterButton"value='0 - 9'/> </td> <?php for($charVal = ord('A');$charVal <= ord('Z'); $charVal++) { $c = chr($charVal); echo "<td>"; echo "<input ".($character == $c? "id='activeCharacter'" : "")." type='submit' name='character' class='characterButton' value='$c' onclick='document.forms.searchParameters.search.value=\"\"' />"; echo "</td>"; } ?> </tr> </tbody> </table> </form> <br /> </div> <!-- END:SEARCH --> <!-- BEGIN:PLAYLIST --> <div id="playlist"> <div id="playlist_wrapper"> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th colspan="3" align="left"> Playlist results </th> <th class="links" align="center"> Links </th> <th align="left"> Album </th> <th align="right"> Time </th> </tr> </thead> <tbody> <tr> <td colspan="6" id="td-playlist-paging"> <?php if(is_array($playlistSongs) && (count($playlistSongs)>0)) { ?> <?php if($start > 0) {echo $prevlnk; } ?> [ Showing <?php echo "$first to $last of $cnt"; ?> ] <?php if(($start+$limit) < $cnt) { echo $nextlnk; } ?> <?php } ?> </td> </tr> <?php if(is_array($playlistSongs) || (count($playlistSongs)>0)) foreach ($playlistSongs as $key => $playlistSong): ?> <tr> <td> <?php echo $key+1; ?> </td> <td> <?php if(!empty($playlistSong->picture)) : ?> <a href="<?php echo $playlistSong->buycd; ?>" target="_blank"> <img id="rpPicture<?php echo $key; ?>" style="display: none;" onload="showPicture(this, <?php echo SHOW_PICTURES; ?>)" width="60" height="60" src="<?php echo $playlistSong->picture; ?>" alt="Buy CD!" title="Click to view CD info" /> </a> <?php endif; ?> </td> <td> <?php echo $playlistSong->artist_title; ?> <?php if ($playlistSong->isRequested): ?> ~requested~ <?php endif; ?> </td> <td align="center"> <?php if (ALLOW_REQUESTS) : ?> <a href="javascript:request(<?php echo $playlistSong->ID; ?>);"> <img src="images/request.png" alt="Request this track now!" title="Request this track now!"/> </a> <?php endif; ?> <a href="<?php echo $playlistSong->buycd; ?>" target="_blank"> <img src="images/buy.png" alt="Buy this CD or Track now!" title="Buy this CD or Track now!"/> </a> <a href="<?php echo $playlistSong->website; ?>" target="_blank"> <img src="images/home.png" alt="Artist homepage" title="Artist homepage" /> </a> <a href="javascript:songinfo(<?php echo $playlistSong->ID; ?>)"> <img src="images/info.png" alt="Track information" title="Track information" /> </a> </td> <td> <?php echo $playlistSong->album; ?> </td> <td align="right"> <?php echo $playlistSong->durationDisplay; ?> </td> </tr> <?php endforeach; ?> <tr> <td colspan="6" id="td-playlist-paging"> <?php if(!is_array($playlistSongs) || (count($playlistSongs)==0)) { ?> No matches found. Please try another search. <?php } else { ?> <?php if($start > 0) {echo $prevlnk; } ?> [ Showing <?php echo "$first to $last of $cnt"; ?> ] <?php if(($start+$limit) < $cnt) { echo $nextlnk; } ?> <?php } ?> </td> </tr> </tbody> </table> </div> </div> <!-- END:PLAYLIST --> <?php require_once('display.footer.php'); ?> </div> <!-- END:PAGE --> <!-- JQuery to round corners some of the HTML items on the page --> <script type="text/javascript"> //<![CDATA[ // Make sure the DOM is ready $(document).ready(function() { // Rounding of corners (Cross-browser compatible) // See http://jquery.malsup.com/corner/ for different Styles. // Rounds the page corners $('#page').corner(); // Rounds the Navigation Menu Corners $('#navigation dl').corner(); // Rounds the Coming Up Corners $('#coming-up dl').corner(); // Round the Dedication Corners $('#dedication dl').corner('tl tr').corner(); // Round the Top Request Corners $('#top_requests dl').corner(); // Rounds the Playlist and search boxes $('#playlist_wrapper, #search').corner(); // Style odd and even rows in Playlist Table (Cross-browser compatible) $('#playlist table tbody tr:nth-child(odd)').addClass('playlist_odd'); $('#playlist table tbody tr:nth-child(even)').addClass('playlist_even'); }); //]]> </script> </body> </html>Thank in advance for any help! Im trying to make a php page that searchs for whats typed in a field and if it doesnt exits then add. I am tring to use whats below but cant get it to work. Any thoughts <table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <form name="form1" method="" action=""> <td> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td colspan="3"><strong>Member Search</strong></td> </tr> <tr> <td width="78">Username</td> <td width="6">:</td> <td width="294"><input name="myusername" type="text" id="myusername"></td> </tr> <tr> <td> </td> <td> </td> <td><input type="submit" name="Submit" value="Search"></td> </tr> </table> </td> </form> </tr> </table> $myusername = username <?php $con = mysql_connect("mysqlserver","user","pass"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("dbtest", $con); mysql_query("INSERT INTO partylist (Username, Key) VALUES ($myusername , 'keytest')"); mysql_close($con); ?> |