Creating A Result Page From A Result Page...
I have a contact management database (4500 records) where each record contains many columns = a lot of data to look at in one go.
So... I have created a search page to look for "Company" or "Name" which then returns a recordset with a primary ID number and a summary of 5 other fields.
This recordset is then displayed on a results page in a dynamic repeating table which just shows simple record lines.
My aim is to then be able to go from the results page to another detailed result page based on the ID of a specific selected record.
I understand how to generate the recordset from a text box but cannot find out how to create a recordset from a dynamic repeating table.
View Complete Forum Thread with Replies
Related Forum Messages:
Passing Result To New Page.
I have a search result with a link which links to the ID# of the record. By clicking on the link I would like the rest of the record displayed. What will my script look like to pull a particular record ID?
View Replies !
Search Result To Next Page
how do I do those search results with display limit? Like displaying 20 results per page and user have to click NEXT to view next 20 results. And of course a BACK link too.
View Replies !
Split Result In Different Page
The below code search for image in a directory and show them in row of 5. <?php $image_counter = 3; $row_counter = 0; $cell_counter = 0; $show=array('.jpg','.JPG','.gif','.GIF'); $path = './images/' $dir_handle = @opendir($path) or die("Unable to open $path"); $image_table = "<table> <tr><th colspan=5>Existing Pics in Directory:</th></tr> <tr>"; while (false !== ($file = readdir($dir_handle))) { if(in_array(substr($file,-4,4),$show)){ if(!(($image_counter + 2) % 5)){ $row_counter++; }.
View Replies !
Search Page Result Links
I have a search function pulling data from a MySQL db which works nicely - other than the fact that I can't get the URL to link correctly when the linked document is located in the home directory. All other docs are located below the home directory by group/project/category. When I try to use an 'if' statement for one of the query parameters, I either lose the link, get a link that has the doc that is in the home directory with the full path (that doesn't really exist as folders), or get an undefined index error. Here is my current code - I have edited it several times over that past couple of hours, so I have reached the point of not being able to tell what is correct, and what isn't. I have used projCode, groupCode, projID, groupID parameters and still can't find the magic solution. I would really appreciate another set of eyes. ---snip--- mysql_select_db($database_website, $website); $query_search = "SELECT Distinct docURL, docTitle, docDesc, docs.projID, groupCode, projCode, catName FROM docs JOIN subcat on subcat.subcatID=docs.subcatID JOIN cat on cat.catID = subcat.catID JOIN groups on groups.groupID=proj.groupID JOIN proj on proj.projID=docs.projID WHERE proj.projID=docs.projID AND docURL LIKE '%$keyword%' OR docTitle LIKE '%$keyword%' OR docDesc LIKE '%$keyword%'"; $search = mysql_query($query_search, $website) or die(mysql_error()); $row_search = mysql_fetch_assoc($search); $totalRows_search = mysql_num_rows($search); $proj = $row_search['projCode']; ?> <?php if ($totalRows_search < 1) { echo "No internal documents matched your request."; } else {?> <p><table width=95%> <tr><td colspan="3"><font size="+1">Internal Documents:</font></td> </tr> <tr> <td><strongLink </strong></td> <td<strong>Description</strong></td> <td<strong>Project </strong></td> </tr> <?php do { ?> <tr> <td> <a href="<?php if ($row_search['docs.projID'] == 1) { echo $row_search['catName']."/".$row_search['docURL']; } else { echo $row_search['groupCode']."/".$row_search['projCode']."/".$row_search['catName']."/".$row_search['docURL']; ?>"><?php echo $row_search['docTitle'];......
View Replies !
Exporting Database To Excel Result Page
My data exports without issue, until I get to the very bottom... if I include header("Location: exportresult.php") print "$header"."$data"; then I am transferred to the result page, but the excel file does not export. If I include header(Location) after the print line, the excel file exports but I am not transferred to the correct result page... is there any way to get to a confirmation page that the file has exported? if ($header!="" && $data!=""){ header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=$title.xls"); header("Pragma: no-cache"); header("Expires: 0"); //header("Location: exportresult.php"); print "$header"."$data"; } else { header("Location: exportproblem.php"); }
View Replies !
Page Numbering - Display A Set Amount Of Records From My Result.
I am having a problem with trying to display a set amount of records from my result. I have modified the Page Numbering tutorial from this site and adapted it to use MSSQL. I have verified that the correct values for my variables are being passed to the query. The calculation for the records that should be displayed per page is correct. The total number of records returned from my query is correct. And the calculated number of total pages to be displayed is correct. So, initially it displays the first 10 results as it should, and has the pages numbers at the bottom. The problem is, when I click on a different page number the same 10 results are ALWAYS displayed. Even though my $page variable IS being updated. Code:
View Replies !
Creating Table Rows Based On Query Result
I am trying to create a simple table with a fixed number of columns (5) but the number of row will depend on the results of the query. I have tried various examples found here or there and I can't get them to work. Code:
View Replies !
Displaying Result 1-8, Then Result 9-17 Etc.
I dispaly the results from the database like this. <? while ($row = mysql_fetch_array($prod_result)) { $small = $row[0]; echo"<td align=center><img src="produkter/hardware/decks/$small"></strong></td>";}?> But if there are more than 8 results, I wnat to dispaly the first 8 on one page, then the next 8 on the next page...How can this be done?
View Replies !
Nesting Result Loops Within Result Loops Possible?
I'm looping through a query, and inside the while result output, I am trying to loop through a second query (created from the 1st query's row results). I have checked that both queries return info. I can see that the 1st while result output works fine, but when I get to the inner while result output, it never returns any rows (nothing in the while loop evaluates). So, IS it possible to nest one query's output loop within another, or am I doing something wrong?
View Replies !
Creating A New Page?
I want to be able to allow users to sign up to my community site, and create a folder from their username. So their page on the site will be www.site.com/user. Making the folder part is fine using mk dir. However, i have no idea of how to create an index.php file that has my profile template on it or how to pump out the correct users data. I imagine though that the file is created with a variable in it such as $user = x so that it pumps out the correct user data.
View Replies !
Creating Page Titles On The Fly
Does anyone know a way to create page titles on the fly using php scripts? Obviously, I chose PHP so I wouldn't have to make hundreds of individual pages...so I was hoping there was a way to also create dynamic page titles as well.
View Replies !
Creating Page Numbers
This is what i'm essentially trying to do. I'm reading a load of rows from a DB (lets say 97). I want to show 10 rows in 1 page. so that would be 10 pages with 9 having 10 entries and 1 with 7 pages. I start off with reading all the entries at once. so i get 97 rows and store it in $result. The first problem i have is how to get the number of pages. 97/10 returns 9.7 - is there any way i can get 9? I've found that the only way to do this in PHP is with $pages = (( $numberOfEntries - ($numberOfEntries % $numEntryPerPage)) / $numEntryPerPage); Secondly, how would i go about making the links to the page number on top? like say 1,2,..9,10 and Third, how would i read those from the $result? Like when i click on 2 how would i go about reading rows 11 to 20?
View Replies !
Creating A Folder And Page
im is create a php script which when you register (registrationlogin script already made) it will create a folder where it gets the name from the username field and password the folder with the password from the password field it will then create a page in the folder called index.php (i can make the page i just need help with the script to make the folder and page).
View Replies !
Creating A Page That Has Pagination.
i'm creating a page that has pagination. but the data just gets listed on and on . is it possible for a 5 data to go across in a single row, then break, and another 5 data across again, like in this image: Code:
View Replies !
Creating A User Page
I have set up my website to have a login system with username and password. I want everytime a user logs in to have there own account page.
View Replies !
Creating A Search Page
I've seen some articles on creating a FULLTEXT search on my database, but that looks like it's only for 1 table. So I'm looking to build my own search page, where users can search the whole database, not just 1 table. How can I do this? Sorry if this is too complex, but I figured it can't be THAT hard since lots of people have search boxes on their sites.
View Replies !
Creating Seperate Page
After a sale, my "Thank You" occurs on the same page (url) that generated the sale using?php if($showThanks). I want to take the user to a seperate page altogether. How do I do that?
View Replies !
Creating An Admin Page!
I would like to create a simple admin page admin/index.php I don't need a username/password login, I will simply use a password protected directory to secure the admin folder. Code:
View Replies !
Creating An Error Message Page?
The code below creates an error message and then displays it if needed. When the messge is displayed though, its diplayed along with all the other stuff on the screen at the time. Is there a way to blank the page first, before displaying the message. PHP Code:
View Replies !
Creating A Session Variable On Every Page
I'm using PHP 4.4.4 with Apache 2.2. What I want is that if a customer visits any page of the top level directory of my site with this string passed in the URL's query string, "RID=xxx", I would like a session variable called "RID" with the value "xxx" to be created. However, I would like to avoid putting this code session_start(); if (!empty($_REQUEST['RID'])) { $_SESSION['RID'] = trim(strtoupper($_REQUEST['RID'])); } // if on every page in my top level directory. Does anyone know a more efficient way?
View Replies !
Creating A Users Online Page
I'm currently creating a Users Online page for my php forums. And I was wondering about a couple of things. When the user logs in, the script I created saves the username/session_id into a DB table called users_online, and lists the elements of that table on the Users Online page. All good and nice except for two things: - How can I remove a user from the online list (DB?) when his session times out and he's offline? I wrote a simple function that remove him from the Users Online page if he clicks the logout link, but what if he simply closes the browser window? He'll just stay on the online list. - How can I prevent duplicate usernames from showing up in the users online page? For example, I log into my account from two different browsers, each with a different session, and it shows the username twice! What to do?
View Replies !
Creating A Login And Update Page
I've recently had a request from a couple of clients for a login and update page. I know this can be done using php. They want a login page to access a secure part of the website and then alter a couple of pages to update. I've tried a couple of different things such as creating an ftp client, which I'm not sure is the right way to go about it, plus it wouldn't work after so far following an online tutorial, I could only attain the server information in a list, couldn't make it so it was editable, I've also tried creating a login page using a tutorial, but I don't see how that's going to help me unless I find a way of being able to edit (add to a table of contents) once i'm logged in.
View Replies !
Creating A Product List Page!!!!
I was able to retrieve information from the database but I get an error message that says "Notice: Undefined variable: SubCatID " and I can`t get my list to display right. I wanted my SmallIMG to be on the right and my and my ProductName to appear right beside it along with the UnitPrice. Kinda like straight across because I want it to be a link to the individual product page. If I can get help on this part, I can get started on my shopping cart. Code:
View Replies !
Creating A Password-protected Page
Running a website for a non-profit org who wants a "members - only" section for their newsletters, rehearsal info, etc. It would look better than posting it for all the world to see. I use Frontpage, but not extensions. My webhost won't write a script for me. I have cPanel, but I'm such not a programmer etc that without my hand being held every step, I cannot figure out the right things to do actually DO in the right order and make it work.
View Replies !
Having Trouble Creating A 'News' Page
I am working on making a news section for a website. There are 2 main components that I need are 1) A Page(code) for a user to add news (no checking authorization required yet) 2) A Page(code) to display the news The 'news' will consist of the following data 1 - A Title 2 - A Story 3 - Date to start Displaying 4 - Date to stop Displaying Parts 1,3,4 will be single lines, however part 2 might be multiple lines long.
View Replies !
Creating Master-Detail Page
I have an array that holds all of the information I want displayed. Dreamweaver, on the other hand, uses a MySQL statement stored in a variable... As such, I'm wondering if any of you out there know how to create a master-detail page that has a first page, previous page, next page, and last page link that allows me to display 10 records at one time. Also, when I go to the detail page, I especially need to know how to get the specific row's information transferred. If anyone has any ideas, that would be great.
View Replies !
Creating A Custom Index Page
Is there any function that when given a directory name as its argument, returns an array containing the names of all the files in that directory, or all the directories in that directory, or both (as a multi-d array, I'd expect)? I assume such a function could be used on the directory the php program running it is contained in, yes? (If yes, please be clear on how.) Code:
View Replies !
Creating A Page From A Database Entry?
I have a database for reviews, and from it I am able to call a mini index of it's content, listing only the date of the review and the author. I currently have a 'review icon' which links to the main review on another page via the review's id in the datebase. ie fanreviewid.php where id is replaced by the numerical equivalant in the database. Anyway, what I was wondering is rather than actually manually having to create this fanreviewid.php page, if there was a way that I could automatically create the page to a set template and by using the same input that's used when the review is initially entered into the database. Code:
View Replies !
Creating .xls And .doc Files With Page Breaks Using PHP / MySQL
Our company currently processes a few hundred form submissions through our site. Up till now, the contents of the form has been sent to our customer support staff in real-time. Each submission goes to a general e-mail box where it's printed through our mail client. A copy of the form is also stored in a MySQL db, although it's not used that often. I have been asked to figure out a way to stop delivering the form submissions in real-time and migrate to the following: Each morning, provide an Excel spreadsheet and word document (or PDF) with a certain number of form submissions to each customer support rep. For example, say 200 form submissions were processed the day before. This morning, I should split those 200 among the 5 support reps and provide each of them a certain amount (which can change daily). Assuming each person gets 40 form submissions, each person would need to be given an excel file and .doc document that contains their 40 form submissions. One of the most important things is that the .doc file needs to have each form submission separated by a page break, so that when they print the document each form submission is printed on a separate page. Finally, not all of the fields from the form submission should be given to the support rep. Maybe date and time is left off.
View Replies !
Creating Configuration Page To Alter Config.php
I'm creating a web-based database thingy for the organisation I work with- and of course there are a bunch of variables that I don't want to be touched by end-users, but then there are a few that I do want to be changeable by a 'super-user/moderator.' I'm trying to come up with the best way to create a 'configuration' part of the 'admin' section, which has the options to change, which will then open the particular file (let's say config.php) and edit those particular variables.
View Replies !
Creating Dynamic Page Based On Dropdown Selection?
I'm using Dreamweaver, but I believe this is a general PHP/MySQL question. I have a table, with 4 fields: id, year, car_make, car_model. The data looks like this: 1 1992 Honda Civic 2 1994 Ford Probe GT 3 1999 Audi S4 4 2002 Porsche 959 On my web page, I have a drop down list that's propogated automatically with the "car_model" field entries which are pulled from that table. So when I click the down arrow, I see Civic, Probe GT, S4 and 959. Code:
View Replies !
SQL Last Result
When querying and doing a loop I want to specify that the last result of the loop does not include a horizontal line. How would I do this?
View Replies !
Get More Than 1 Result
I have wrote a PHP script, with MYSQL, that reads a database based on users input. When the criteria only matches one result in the database, everythings fine. But when the data has two results I need to display, I only show one. Do I need to write some kind of loop?
View Replies !
Zero Row Result Set
When I am doing a search, if there are no results, PHP Code: $num=mysql_num_rows($result); gives me an error. I want it to say something like "There are not matching records." Instead, it returns a message that says: PHP Code: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:WAMPxampphtdocsregsearch.php on line 30 How do I avoid returning this error message?
View Replies !
Outputing Result Once Only
Hi, I have a php script that looks up mysql records, on the basis of keywords entered by the user. The records are in tables making up a message board system, and the search works both for 'top-level' messages, and for replies. The results lists the 'top-level' message (ie the entire thread), even if the search matched text in a reply. However, I am having a problem making sure the thread is not listed more than once if the search matches several replies in the same thread. At the moment, the search looks up all the rows containing the search text, then the message starting the thread if the search has matched a reply, and the results are output in a while loop. I have tried making a long string containing all the id's of the displayed rows, usingsomething like $displayed .= _$row[id]_ in the loop, and then ereg("_$row[id]_", "$displayed", $array) earlier in the loop to see if this message's thread id is already listed, and skipping it if it is. However, I can't seem to get this to work. Also, this seems like a really inefficient workaround. Is there a better way to do this?
View Replies !
Result Using Two Variables
Probably a real simple solution but I can't for the life of me work it out. I have: $pollitem_1 $pollitem_2 $pollitem_3 $pollitem_4 if I do a for loop for the amount of items, is it posiible to have a variable for the number after the _ ? e.g....
View Replies !
Weird Result? Php 4.4.0
I have a variable v with the value -1. After v++ it has the value "" not 0. Since I am using it for a subscript, the "" value is not overwriting the 0 element of the array as desired. Should v++ ever give a non-numeric value?
View Replies !
Result Set Problem
I am new to programming in PHP however, this should be a pretty straight forward answer. I have three queries that I am pulling for a content form page. 1) The Author List 2) The Content Page (pulls the PK, Title and the Description of the content. 3) The Category List When I attempt to pull the data the only result set I get back is from the Item #1 query above. Now, I made sure that there is data in the tables, but I still get no data back for the other two queries(????) Is there something that I missing when connecting to PHP/MYSQL? Do I need to take some additional steps?? Any help would be greatly appreciated. I've been struggling with this problem for several hours now scratching my head why this is. :-) // here is the PHP Code I am using <?php $db = mysql_connect("$DB_SERVER", "$DB_SERVER_USERNAME", "$DB_SERVER_PASSWORD"); mysql_select_db("$DB_DATABASE",$db); //result set 1 - get members $result_M=mysql_query("SELECT * FROM tblMembers",$db); $myrow_M=mysql_fetch_assoc($result_M); //result set 2 - get content ID $result_C=mysql_query("SELECT * FROM tblContent WHERE contentID=1",$db); $myrow_C=mysql_query($result_C); //result set 3 - get categories $result_Cat=mysql_query("SELECT * FROM tblCat",$db); $myrow_Cat=mysql_query($result_Cat);.....
View Replies !
Oracle->not Same Result From Php And From Sql*plus
Here is my query, ran from oracle sql*plus: SELECT mrbs_room.id, start_time, end_time, name, mrbs_entry.id, type FROM mrbs_entry, mrbs_room WHERE mrbs_entry.room_id = mrbs_room.id AND area_id = 101 AND start_time <= 1076068800 AND end_time > 1076065200 Here is the correct result : SQL> Connected. ID START_TIME END_TIME NAME ID T ---------- ---------- ---------- ---- -- - 82 1076065200 1076068800 test 41 I Ran from php, I got this : ID START_TIME END_TIME NAME T ---------- ---------- ---------- ---- -- - 41 1076065200 1076068800 test I the two ID fields are named with their table name, but php keep the second value and display it as the first one.
View Replies !
Paging Through Result Set
Using PHP to query a MYSQL db, I am attempting to portion the result set on multiple pages. I see this technique used on this site. example: If a user query yields 30 results I want to display 5 results at a time allowing the user to page forward or back through the results.
View Replies !
Result Handler Set?
I'm getting an error which get's reported something like "can't save result handler blabla".. .. i didn't note the exact error at the time and i can't bring it back cuz i deleted my whole database and started from scratch.. anybody know what this is about?? i'm pretty sure it's something to do with mysql.. it shows with mysql_error().
View Replies !
Search Result Help
I am trying to do the following with my search script that looks for records in a mysql table. The following is an example of what I am trying to do. Text being searched: -- The brown fox jumped over the green fence then jumped into the web monitor. It was hurt so it jumped backwards and fell on its! -- The word we're searching for "web". The results should look like -- ...then jumped into the *web* monitor. It was... -- Are there any functions out there that will do this? Or what would it take to make one?
View Replies !
How Could I Paginate The Result Set?
I would like to do something like this: select * from myTable where ... pagesize 10 page 1 How could I do it elegantly in: 1. PHP+MySQL before MySQL 5 (without stored procedures) 2. MySQL alone (with stored procedures)
View Replies !
|