Navigating Database Results And Problem With Link
I am loading results from mysql database and displaying on my page and then dynamically displaying only 5 results per page. On each page I have a POST button so that if user wants to POST something on form he should be able to do it whether he is on page 5 or page 1. When I first time loads the results on page 1 this POST button works fine but when I go to page 2 and click on POST it gives following error
" CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: " and then even if I go back on page1 it starts giving me same error.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Navigating Database Results And Posting New Values
I am trying to dynamically display results that I retrieve from my database i.e. only 5 results per page and code should automatically compute how many pages it needs and create links for each page. I have also added a link at the top of my page so that if user wants to POST new data he can post it. Problem is that when I click on page 2 or 3 or any numbered page and click on POST link it gives me following error "CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: And it did not tell about any header etc. Code:
Navigating Multiple Results?
Hi all, whats the best way to navaiagte multiple page of results. <Previous 1 2 3 4 Next> What SQL is needed to do a limit that starts in the middle of a returned set. SELECT * FROM table LIMIT BETWEEN 20 TO 50;
Creating A Link Within Table Results?
I am using php and mysql. Does anyone have any pointers on how to include links within table results that point to additional information also pulled from the same db table? I have some extensive info that I want to query. The intial results are going to be displayed in a simple wire frame html table layout. I would like each row to include a link that will take the reader to a more detailed version of the data for that particular row, and that more detailed data will of course come from the same db table. My problem is I don't know how to setup the code to create such link.
Output Results In Link Form
I have script that includes a query that should output a link. The link is actually an image. So from the table it will get "image.jpg" while i will be providing the full href for it so that i becomes a link. My question is how do i use PHP (or PHP with JS to open up the image according to the image's size. Thus i dont need to define a fixed size always. PHP Code:
Display Number Of DB Results Beside A Link?
For an example, if you look at www.menupages.ie they give you a preview of how many results are found for each link. ie: Ballsbridge Restaurants (52) Blackrock Restaurants (17) Clondalkin Restaurants (18) Clontarf Restaurants (17) How is this achieved. I take it that it must be a select count on the DB for each row but that seems pointless, is there an easy way to achieve this?
Link To Form Results Page Dynamically
I have a dropdown box that pulls information from a database. What I want to achieve is that when a caller selects an option, the option determines that page that comes up. I tried setting the form action to the name of the option, but this down not bring up anything; actually the resulting page is .php. I also tried moving the form action statement after ther selection, but that does not work either - the Submit button does not work. PHP Code:
Making The Results Of A Search Engine Show As A Link
I made a simple PHP search engine for my web site. the problem I'm having is that the results show as regular text rather then a link to the page found. I need to know how you use A HREF with a variable. below is the section of my code that I figure I need to modify. $row = mysql_fetch_array($result); echo ($i+1).'<strong> URL: ' echo stripslashes($row['url']).'</strong>' echo '<br />'
Navigating An Array
let's say you have a numeric indexed array with 30 elements. Now let's say you want to only output elements 10 thru 20. Is this possible?
Navigating Between Pages Of Array Contents
I didn't know how else to name this thread...but what I am trying to do is echo out the data in my database so that there are only 9 entries per page. At the moment, all I have been able to do is show the next 9 rows of data on a page, then assign all the other rows of data into a new array, which i would then pass to the next page in a cookie and start over again using the new array. As well as being sloppy coding, this is at a disadvantage because you can only every go to the 'next page'. You cannot navigate to the previous page unless you click back (and that won't always work) and you can't navigate directly to any page. I think what I could perhaps do is take my original array, and split it into individual arrays of 9 rows, and then store each of these in a session. This is still at the disadvantage that it will only work if you go to page 1 first - people won't be able to link to a different page. What would be the best method of being able to navigate through the varying pages of data? And as I have never used sessions before, could somebody please show me how to get started, or at least link me to something that is easy to understand. Thanks!
Sign-in Link To Database?
I am building a website for a friend and in the website we want to have a login area for the members to type in there password and username. The username and password are in connection with the phpbb2 forum we are running. I'm curious as to how I would create a sign in area for the members to use on the main page that would be linked with the phpbb2 database. How would this be possible? I've asked on other forums and no one has helped yet. I figured I would try here and see if anyone could give some suggestions.
Link Indexing / Database Script?
I've been searching forever to find the right free script for my website. I want to make article/link database on my gaming site... here is an example... Click me. I want it to function nearly exactly the same as this (but I'm aware this is done in asp) I want user to be able to add to the database & rate the article/link (with a 5 star rating if possibe) and add a comment/review (again if possible) Many large sites seem to use the same kind of system... so there must be one out there! I want to use the database for my links page. Also I have pages were I have written articles... I want to add "user articles" underneath... which will show a catagory from the database. So I'd say the script would come under the catagory of link indexing or reviews/ratings... or database lol The reason why I need it in php is because my pages contain php include commands, that include news from my forum... If I used ssi to include instead what scripts could I use then? Seeing as I'm having no luck finding a php script I can use. One last thing... I would need to be able to edit the design... so it will fit nicely into my site.
Link Entry In MySQL Database
i have a database with rateid, bandid and a rating, how can i like each bandid to different pages, so bandid 1 will link to bandid 1's profile page and bandid 2 will link to bandid 2's profile page. any ideas?!
Identifying Opening Link For Database Query?
I've got a tricky problem i need to solve, i'm building a banner exchange type site in which there are already about 100 banners so i've had to code things around what already exists to a certain extent. Now each of the banners that go out on other sites have a link on the banner which pops open a window with details of the banner. this would be fine if all my banners were gifs and jpgs but there are also swf and dcr banners so i have no real control over the actual link on the banner. up until now each banner had a html page made for it so when you clicked on a banner it would open a page banner_1.html which had the details of that banner. for obvious reasons i'm going to replace all these redundant pages and put a htaccess redirect at their url to all redirect to a common page popup.php so all details will be dealt with in one file. ok this is fine but my problem is in this page popup.php i need to identify the link that just opened the window so that i can then get the info from the database to put on the page.. remember i can't use the url like so... bannerpage.php?thisbanner=1 but all existing links have unique addresses, is there a way to do this, i'm pretty sure there must be but i can't get my head around it?
Simple A-Z Link List For Searching Mysql Database
I'm trying to set-up a simple A-Z list so that people can search a mysql database by each letter. Click on "A" get all records in the DB that start with "A". I have it working no problem but i want to be able to add "#" so that the user can get all records that start with a Number. For some reason the query i'm running won't grab any records that start with a number? here is the query:
Getting Results From MySQL Database In PHP
I am trying to write a php page which connects to a MySQL Database which is supposed to get the results from a table within a database and display the results in a table. Below is the code that I am using:
Database Search Results
i have a paid to read website,im hosting it off my own pc..as a member you can search offers and complete them, heres where i need some help..when a member clicks submit and the offer goes to an offerdone table i need the offer to hide from them so they cant do it again,also that same offer needs to hide in the search results as well...is there somthing like onclick hide and for the results something like if duplicate hide from search or if offer found in this table hide from results... there are 2 tables one will all my offers the other with offer they have done,also this needs to apply for each member account.i am new to all this and have made it this far to have my site up and going but im looking for those extra catchs i could really use,so that a member cant repeat an offer they have already done,
Grouping Database Results In Pagination
I'm dealing with a situation where I can potentially have over 3000 results to display from a database. I'm successfully paginating the results, 10 at a time, but don't want to display 300+ page links at the bottom. How can I group the pages to show, for example, the first 10 pages, followed by a "next 10" link? i.e., Page: 1 2 3 4 5 6 7 8 9 10 > >> Next 10 My current code:
Sorting Database Query Results
I want to know if it is possible to sort query results so that the records with a value in a certain field is displayed first and the records with the field empty thereafter.
Showing Image With Database Results
I am trying to retrieve data from a MySQL database and have got it working. Only thing is I would also like to display an image for each row. Each record has a file number and the images are all saved in an image folder and are named with the actual file number. EG there is a record with file number 1111 and there is an image called 1111.gif in the images folder. I have included my code below. If someone can tell me how to include some html code to show the image in my php code. Code:
Problem Retrieving Results From Database
I'm trying to retrieve fields from my database with following mysql statement: $query = SELECT g_games.Title FROM g_collections, g_personal_reviews, g_games WHERE (g_games.ID=g_personal_reviews.G_ID AND g_collections.U_ID = '" . $data1['ID'] . "' AND g_personal_reviews.C_ID = '" . $data2['ID'] . "' ) "; $resultset = mysql_query($query); $data = mysql_fetch_array($resultset); 3 Rows in my database comply with the above statement... though I only get 1 to show up on my php page? How can I show all of them? This is the php code I'm using to write the results: while ($data= mysql_fetch_array($resultset)) { echo $data[Title]." "; } My tables are as followed: g_games g_collections g_personal_reviews > this table connects all others with G_ID ("game ID"), C_ID ("Collection_ID"), U_ID ("User ID)... users
Putting Database Results In A 5x1 Table
I have a db of tens of thousands of entries. It's not too hard to pull all the entries and build a table that displays them one at a time, but in my case, that will be a huge waste of space. What I want to do is put one record in each of the columns. I thinks it's possible to do because I have seen very elaborate thumbnail gallery scripts to do this. I just want to be able to put two or three strings of text from each record into each row, and a checkbox. Here's sample of what I mean: <table width="76%" border="1" cellspacing="1" cellpadding="1"> <tr> <td>$record1Line1<br>$record1$Line2<br> <input type="checkbox" name="$record1checkbox" value="checkbox"></td> <td>$record2Line1<br>$record2$Line2<br> <input type="checkbox" name="$record2checkbox" value="checkbox"></td> <td>$record3Line1<br>$record3$Line2<br> <input type="checkbox" name="$record3checkbox" value="checkbox"></td> <td>$record4Line1<br>$record4$Line2<br> <input type="checkbox" name="$record3checkbox" value="checkbox"></td> <td>$record5Line1<br>$record5$Line2<br> <input type="checkbox" name="$record5checkbox" value="checkbox"></td> </tr> </table> I want to pull about 200 records at a time from the db and display as described above. How can I tell php to take five records from my result set and display above, then loop through the result set until I'm done?
Filtering Results By DATE Value In Database
I have this code in my page for displaying some data from a database, sorted by date. i had posted a messed up version of this a while ago but I couldnt get it working even after a few suggestions. PHP Code:
Populating A Drop Box With Results From Database
I have a MySQL database with a table (category) with two fields, catId (int) and category (char(50)). What I want to do is to get all category names in this database and place all of them into a dropdown box on a web page so that the user can choose from the list of available categories.
Displaying Database And Getting Unwanted Results...
I want to display everyone in the database, but only if the 'level' field is larger than 0. Well, this works fine for most of the database... but if the last entry in the database is 0, then it prints it anyways. Is there anyway around this? I tried adding an if statement before the last bit where I echo out the table rows, but it was killing the entire table, or still showing the same results. Code:
Function To Fetch Database Results
I have a function that is supposed to fetch all the results from my table "games". There are two database records in that table. My function is supposed to display all of the records, but it only displays one. I also use a function to display a certain template. Here is the coding for both functions and my index. Code:
Counting Results From A Mysql Database
I want to know how many results throw a query in order to know if they have reached a limit.I.E. $sql = mysql_query ("select * from classifieds where user='$username'"); while ($row = mysql_fetch_array($sql)){} I want to check lets say that only 10 classifieds per 'username' can be created. If ten or more classifieds are in the database for that 'username' then show error message.
Displaying Results From Database In A Particular Format
How do I display results from a database in a particular format. For example the following text in this format including the lines in stored in the database: Quote“Hello, Welcome to the news for 11/06/07. Thanks” When I echo the results using the usual, <? echo $row_news[‘news’]; ?> it doesn’t echo the information in the database in the format it is stored for example it will display like this. Quote“Hello, Welcome to the news for 11/06/07. Thanks” How do I get it to display in the format it in displayed in the database?
Display Results From A Database On Multiple Pages
I am new to PHP and Mysql but am really determined to learn these techniques. I have some script that reads and displays results from the databse onto a page. However, I really wish to limit the number of results that are displayed to 10 per page and then have the next/privious links under the results. With these results, the results under the email field should be hyperlinked so that the person viewing the results should double click on the email link and send the person an email. How can i do that? I have to learn this technique. The code is:-
POST To Mysql Database And Email Results?
I have a simple html form that POSTs to a mysql database. Can I, and if so, how can I, have it post to the mysql database, and email the form results too. I also have some other html forms that just mail() the results. So I can do both things separately, but I'm not sure how to combine them.
Populating Form From Database, Then Passing Results To Next Page
I have a multiple select input in a form that's being populated by a row from my database as such: <input type="checkbox" name="subm[]" value="$row[ID]"> That part is working fine as I can check the displayed page using View Source and see that the value is the correct row number from the database. It is then being submitted on a form by $_POST method to another page where I want to evaluate the checkboxes and display the contents of the entire row that corresponds to each value="$row[ID]" that have been checked. But I can't seem to get it to work. I'm having a problem passing the selected value. Can someone point me in the right direction? $query = ("SELECT * FROM `table`"); $result = mysql_query($query); print "<p>Data for Selections:"; print "<table border=2><tr><th>You chose:"; foreach ($_POST['subm'] as $value) { print "<tr><td>"; print "$row[ID]; "; print mysql_field_name($result, 1) . ": " . $row[name]."<br>"; print mysql_field_name($result, 2) . ": " . $row[address]."<br>"; print mysql_field_name($result, 3) . ": " . $row[city]."<br>"; print "</td></tr>"; print "</table> "; } if (!isset($_POST['subm'])){ print "<p>No matching entry "; } mysql_close();
Sort Results By Date/time, Limit 5 Database Entries Of Today &/or Upcoming Days
I'm designing a website for my fraternity and in the database I have entries which contain past events, todays events, and upcoming events. My problem is that I can not figure out how to sort the query results to display: 1) only past events based on the CURRENT DATE 2) only the events which fall on the CURRENT DATE or after, limiting the results to 5 entries 3) all events that fall on CURRENT DATE or afterwards Example: Today is September 15, 2007 Problem 1) Displaying all events that happened before September 15, 2007 Problem 2) Displaying only 5 results that fall on September 15, 2007 or after Problem 3) Displaying all events that are happening on or after September 15, 2007 And obviously I would like the CURRENT DATE to change depending on what date it is, currently. Ok so now I've been very redundant in my explanation of my problem here is the code and a link to what that particular page looks like. Code:
Dynamic Download Link - Not Direct File Link
I'm posting a podcast feed that makes reference to audio files for download. Instead of linking to the files directly (e.g. www.mywebsite.com/podcast.mp3), I want to link to the file as get variables so that I can track number of listeners (e.g. www.mywebsite.com/?audio=podcast.mp3). Where would I look to get something like this to work? How do I start sending audio data to the user using a link like this?
Determine If User Came From Inner Link Or An Outside Link
any php method or function to determine if a user came from within the website or from an outside website. I have a page that I want to display in different manners depends on how did the user arrive at my site. I know about the HTTP_REFERER function. but don't really know how to use it. I know this is the syntax: <?php echo $_SERVER['HTTP_REFERER']; ?> but when i entered the code in the php page. for instance test.php, there is nothing coming up. So my questions: 1. is there any other method? 2. could any of you maybe specify a bit more details about this function and how to use it.
Search Brings Back Different Results Or Sometimes No Results
The problem Iv got is that when searching the site - it brings back different results or sometimes no results. For example: "i026", "i 026" and "026" do not bring back results for "I-026" which is the correct model number. Any ideas on how to make it search more variations or of a "Did you mean... I-026" script?
Search Results ($num_rows) Does Not Match $search Results (PHP,MySQL)?
For example, when I do a database search for a term I get 2 results but the $num_rows says there are 3 results. I suspect it's because there are similar keywords within different search fields of the SQL statement. But I am stumped as to how I can change this. Any Suggestions? the code:
Images In Database Vs. Image References In Database
i kept all of the uploaded images as files on the server, and created links to them in the database. I have been changing things around now (especially directories) and I am thinking of storing the images in the actual database. I read somewhere that this can be considered a bad practice, so i was wondering what the consensus here was. In my opinion, modifying all of the code to point to the correct directories everytime a page location changes seems like a pain in the a**.
Link?=ID#
I am wondering if there is a script/code somewhere to find that hides my actuall links from browsing users, no database related. For example. My links on a webpage link 1 = http://mysite.com/hello.php link2 = http://mysite.com/byebye.php I want to hide theese links and for the outsidebrowsers to look like this: link1 = http://mysite.com/redirect.php?ID=12 same for link 2 but with a different ID hope ypu understand .Please note : NO MYSQL support.
Using An As A Link
Now I am able to practice php on my pc, thanks to previous replies to a post in this forum, here the first of many questions. I want to be able to use an image as a link. So in html I would use: <a href="http://www.somepage.com"> <img src="someimage.jpg"> </a> I have written the php code below (which I am proud of !!): <?php // Switch statement based off server time switch (date('H i D')) { case དྷ 33 Sat': print '<img src="michelle.jpg" border="2" height="170" width="227" />' break; case དྷ 34 Sat': print '<img src="sunset.jpg" border="2" height="170" width="227" />' break; default: print 'Cases not met' } ?> Now the code above does what I want it to do but if I add the line below i get a parse error: case དྷ 35 Sat': print '<a href="http://www.somepage.com"><img src="someimage.jpg"></a>' break; So how do I create a link from the images in my code?
Getting 404 Link
Thanks to my apache .htaccess file, all the 404 errors are redirected to my 404.php file. I'd like to get the following infos : - the page address from which the 404 error come from (I get it with $_SERVER["HTTP_REFERER"]), - the exact link that provoqued a 404 error. How can I get the 2 piece of info ?
Link In If
if i have the following how do i make the new chat message a link? <? $numbernow=($chat[0])?> <? if ($stat[chatnow] < $numbernow) { print "NEW CHAT MESSAGES"; } ?>
Link Regexp
I am try to get all the links out of a document with a regexp.
Link Redirection
Is there any way to redirect a link to another page after it has been first used? Or even kill the link after its first use?
GET Variables Through Link
Maybe this is all just going right by me and I should probably understand this well by now, but it didn't work the first time, and I have yet to find the right answer. I'm looking to have a list of names, like James, Bill, Sam...etc on a page. With these names there will be a work function say Accountant, Billing, Janitor, and there will be another variable like office, 1, 102, closet...etc.
KW To Link Like Phpgiggle
I am looking for a php script like phpgiggle which coverts predetermined keywords into predetermined links each time the keyword appears in the page. Tried to get phpgiggle up and running but with no success and with the author's site down and with no support at all, i am looking for an alternative.
Mailto: Link
My script is <? $MyLink='<a href="mailto:<? echo $Email;?>">'.$Email."</a>"; ?> This is then saved to a file (txt) and the data inside the file is: <a href="mailto:<? echo $Email; ?>">xyz@zbc.com</a> So when I click on the mailto: link the status bar reads:- mailto:<? echo $Email ?> and the mailer opens with no address.
|