Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





View The Query Results One Record At A Time And Cycle (step) Through The Records


I need to know how to use PHP to step (one by one) through the records of MySQL database query result. I am able to connect to the DB and perform a query. I am able to print the results of the query for the ENTIRE query result.

What I need now is to be able to view the query results one record at a time and cycle (step) through the records by using a control (button or link) on the page itself. (The first record of the query result displayed on page entry, a "next" link/button to see the next row of information).




View Complete Forum Thread with Replies

Related Forum Messages:
Convert Query Results To Time Date/time Format
i have a query which displays the start time, end time, and also the duration. these results are displayed, however the duration doesnt seem to display in the correct format, it is displayed as numbers but not in the correct format. Code:

View Replies !
Installing PDFLib Lite Step By Step Instructions
I have been trying to get PDFLib Lite installed with PHP for over a week now and I can't seem to get it to work. I'm hoping some of you may have had some luck installing it yourself fairly recently so you can help. Using the command "pear install pdflib" does not seem to work nor does compiling the latest version myself and using "--with-pdflib"

Has anyone successfully installed PDFLib that can help me out with some step by step instructions? I'm running Suse Linux with Apache 2 and PHP 5.

View Replies !
Step By Step Instructions For Xedbug Install (am Using Eclipse)
I want to start using xdebug. Please help me learn how to install it by
providing links to tutorials (yes, I've googled it) or movies on how to
install and use with Eclipse.

View Replies !
Step By Step Guide On Installing Curl
I've read through the forum looking for step by step guide on installing curl. Everyone seems to be saying "compile php with curl", get a couple of files, paste in this that folder. Code:

View Replies !
Form Validation :: Step By Step
I am looking into form validation for my HTML form. I don't want to use javascript and was looking into using PHP. A crazy thought crossed my mind and I just wanted to get some input.

What if I basically made the form one long if/then statement? I could ask for the first piece of information, test it against some conditions, then if it is okay I allow the user to fill in the next piece of information. I could go do down the page validation each box as we go. I could use hidden on all the text boxes until the previous condition had been validated. Some pseudocode:

<?php
<form action=POST method=registered.php>
<input name"Fname" type="text">
if ($Fname meets some condition)
{
<input name="Lname" type="text">
if ($Lname meets some condition)
{
<input name="Number" type="text>
if ($Number meets some condition)
{
}
}
}
else;
echo "Please enter a phone number";
else;
echo "Please enter a valid last name";
else;
echo "Please enter a valid first name";
?>

I know the code isn't exact, I am just theorizing here. Could such a thing be done? Even remotely similar? I don't really plan on doing this anytime soon, but I was just curious.

View Replies !
Step By Step Upload Tutorial
Does anyone know where I can find a tutorial that actually shows step by step how to define the upload directory, upload log directory, and how they both have to be place in the script as well as where the php script files must be placed in the directory.

I seem to be experiencing recurring trouble with this and I would wrather not continue to bother anyone more than necessary, so if someone can just direct me to a good source of info.

View Replies !
Edit Records From View Script
When I click submit next to a record it does not work. I want to be able to click edit and then be taken to a form with the initial values which I can edit and submit. Code:

View Replies !
Delete Option From My View Records Page
I have a list of things I need to do with my database - but this is my next hurdle - the delete query within my view records page. I want to be able to click on a button or link to delete a record in a table. I was envisaging that each record would have a delete button or link next to it and clicking that would remove it. Here is the script I have created to view "Devices": PHP Code:

View Replies !
Installation And What To Do Next. Step By Step
It says that fisrt I must have a (requirements) APACHE server, PHP , and mySQL to run it. So my friend told me that I should download

appserv because it contains all the 3.

So I download it AppServ 2.5.5, I started the Setup and choose Typical, Server name is localhost (default) <--- is that correct?

then Administrator's Email address, I use my own email add <-- is this also correct?

then http port to 80, username: mysql, password mysql, charset: latin1

After installation there are 2 checkboxes witch is by default are true. start Apache and start sql. Then i click close to finish. Code:

View Replies !
Installation Step By Step
Ok so I got Apache and MySQL on Windows XP

Now the last step is to install PHP:

I made a C:php directory

in there i grabbed php.ini and put it on my C:WINDOWS

Also I put php5ts.dll in the WINDOWSSYSTEM folder

ok so far so good

Now I went to the Apache httpd.conf file,

There I added Code:

View Replies !
View Results Where Date Less Than 14 Days Old
Currently when i add reports i input the date in format DD/MM/YYYY. I then have two different view reports pages. One i want to show reports for the present day, and one for all reports in the past 14 days.

The command i am using for the 14 days is this, but i added a report yesterday and still not getting any results.

$query ="SELECT * FROM jobs WHERE date > DATE_SUB(now(), INTERVAL 14 DAY)";

Can someone see where i am going wrong.

View Replies !
View The Time When Entering Site
I would like to view the time when entering my site, in the format: 18:09 Does anybody know a solution for this?

View Replies !
Limit Record Returns And Next Records
I have my script limiting the number of records returned from a search to 10...

then I provide a link to another php page adding 10 to the offset to return the next 10 records...

however, the next 10 records that are being returned are not of the same query that the person searched for... the 10 records that are returned are starting from the 10th record in the entire dataset...

any ideas on how to bring up the next 10 records from what was already searched for?

View Replies !
1 Record In Database But 2 Records Were Selected?
i'm retrieving a record from database. below the record, i have a yes and no button, where i can let user click and then count the number of yes and no.

everything works fine, but when i start to click the yes or no button, my record ,becomes two records. i only have one record in my database, but two same record was displayed.
this is the code: PHP Code:

View Replies !
Looping Through Records(show First Record And Then Loop)
I am trying to display the first record seperately before looping through the rest of the records in the mysql array. PHP Code:

View Replies !
Moving Through Records In Table In A Single Record Page
I'm trying to create a updates pages that I can move either to the previous
record or the next record within a recordset without having to return to the
repeating list of records after each up date.

Assuming I have done the recordset correctly, which I have and the update
records command as well here is the code I'm trying to use: Code:

View Replies !
Results On Multiple Pages: Storing Search Results Or Query Again
Suppose I have a search result with different pages. I could store the results and get them out of the database with a simpler query for the next page. Or I could query again and display only a portion of the results (eg from 20-30). What would be the most efficient. How would bulletin boards do this, or google?

View Replies !
Deleting Records From Results
I have a simple script that returns a list of a specific member's records in a DB, as below: Code:

View Replies !
Previous And Next Records In Sorted Results
I have an address book db with a php front-end and want to have "previous" and "next" buttons available when viewing an address. When "next" is clicked I'd like it to go to the next record alphabetically. PHP Code:

View Replies !
Execute An Update Query Based On The Results Of A Select Query
I'm trying to execute an update query based on the results of a select query... This doesn't work - any ideas? This is the code I'm trying to get to run (it updates all products which are set to arrive by a certain date if that date has arrived or passed - and there are products that should and should not be updated in the db this is being tested with...): Code:

View Replies !
Record From Today 0 Time ()
I have the date stored using time () which produces an 11 digit long number which is then stored in the database as an 11 digit integer in an "int" field.

I'm just trying to work out how I can find all records from today according to their int time value.

View Replies !
Display 1 Record At A Time
Now, I display all the questions which are in the table.I would like to show one question at a time and provide a submit button and when the user submits it, i would like to show the answer and then proceed to the next question. I guess i need to add some few lines in-order to check this and there will be only 5 questions. PHP Code:

View Replies !
Time Format From A DB Record
I would like to display time from a DB record in a different format than HH:MM:SS. In particular HH:MM AM/PM.

View Replies !
Update Record At A Particular Time
update a record everyday at a particular time dynamically. how can i do this





View Replies !
All Records From Today Using Time()
I have the date stored using time () which produces an 11 digit long number which is then stored in the database as an 11 digit integer in an "int" field. I'm just trying to work out how I can find all records from today according to their int time value.

View Replies !
Display 30 Records At A Time
I have a page which displays the 100s of records from a database. I want to shorten it up a bit and display 75 at a time with a > & < button so the records could be scrolled through. But I dont know where to start?

View Replies !
Update A Record Everyday At A Particular Time Dynamically
i want to update a record everyday at a particular time dynamically. how can i do this?

View Replies !
Display Results From The Results Of Query
Currently I have a search that when someone types for example m32 in to the box, the results are all 'jobs' that are like the postcode 'm32' from the pick up location. It also searches the delivery postcode field, so if there was a job either picking up from m32 or delivering to m32 the results would be displayed. PHP Code:

if ($display == "searchpostcode") {
$sql="select * from tablename WHERE q34 = 'Multiple Sources' AND q39 = 'Job Available' AND q17 LIKE '%$searchpcode%' OR q34 = 'Multiple Sources' AND q39 = 'Job Available' AND q19 LIKE '%$searchpcode%' ORDER BY `id` DESC ";
}

When you type MK in to the search box the results work well, it pulls the 2 jobs because one has a MK pick up post code and the other has a MK delivery post code. This is ok and works well. however now I also want to have a seperate search that goes like this. Lets say I live in Manchester and type M32 in to the search box.

View Replies !
Make The Insertion Of The 3 Records At The Same Time.
I want to know if is possible to insert more than 1 record at the same time in one table, my idea is to have somthing like

name: carlos, john, stephan
address: scholossstrasse, worblaufen, hohgantweg
tel: 123, 234, 324

and to make the insertion of the 3 records at the same time.

View Replies !
Insert Records Into A Database At The Same Time?
What happens when 2 or more users query or insert records into a database at the same time? Does the website crash andis there a way to overcome it? Also, sometimes, when a user inserts a record it gets duplicated in the database 2 or 3 times. why is this?

View Replies !
Last Record In Query, And One Before?
Simply put, I wish to display two records from a MySQL on a webpage. I can simply display 1, no problem. The problem comes when displaying a second record.

say for example, I have a table of 30 records. From this table, I wish to display the first two records (ordered Descending) that are the result of a query. Code:

View Replies !
Next Record Query
I am trying to create previous/next links that will select the next product in my database; however, I have gaps in my ID number for my products that is causing me problems. For example:

The product IDs for shirts are 1000-1014
The product IDs for shoes are 2000-2023
The product IDs for jeans are 3000-3008
etc.

So when it displays the shirt with product ID 1014 and you click the next link, it wants to display product ID 1015 which has no entry. What do I do? I don't mind if it goes to product ID 2000. I just don't want it to display pages without entries in the database.

View Replies !
Record The Date And Time When The User Enters A Page
I have a situation where I need to record the date and time when the user enters a page. And I need to store in an MySQL table later, the stored date and time (when user entered the page) and the date and time of inserting the record (meaning execution of query).

However, the two dates and times are always equal. Is there anyway I can store the original entry time of the user either thru PHP or Javascript?

View Replies !
Record Website Visits According To Local Time (U.S. Central)
I've got a newb question about Daylight Savings Time (DST). First of
all here is some server info:

Apache 1.3.28
PHP 4.3.6
MySQL 3.23.49
Time is set to GMT

My goal is to be able to accurately record website visits according to
my local time (U.S. Central) every day of the year, no matter if I am
in DST or not. I need a full datetime set of information (hour, min,
second, etc).

I have devised this line of code...

$date=date("Y:m:dH:i:s",time-18000);

....but it does not help me when DST changes for me, as GMT does not
observe DST.

Next I tried this:

echo("server time is: " . date("H:i:s") . "<br>
");
putenv("TZ=US/Central");
echo("new server time is: " . date("H:i:s") . "<br>
");

And got these results:

server time is: 17:46:44
new server time is: 17:46:44

Apparently, the server does not allow me to change my timezone to
Central time (because the resulting times are the same). The
application I am developing relies heavily on *accurate* time
information.

View Replies !
Delete Records And Files In 1 Statement At Same Time?
How can i delete records and files in 1 statement at same time?

View Replies !
Query Not Pulling First Record
The script below is supposed to pull ALL the information from a mySQL dbase by date. The problem is that it always leaves out the first record. I can't see where the problem is. Please take a look and see if you can find what I can't. Thanks.

View Replies !
Edit Record Query
I've been using PHP for just over a month and I'm really enjoying it. I'm looking to create an Edit query when I click the edit submit button next to each record in a table.

I'm trying to do it all in one script - viewuser.php this is what I have so far - I don't know what is wrong or why it doesn't work Code:

View Replies !
Query For Last Record Before Certain Date?
I have a table with three columns as so: username (varchar32), punch_type (enum), and punch_date_time (timestamp). Given a date, how can I extract the last punch before a given timestamp for each user? More specifically, I'm building a new timeclock system for my employer. Given a date, I need to know the last action on the timeclock for each user that occurred before the start of the new pay period.

I have something functional but it requires logic in the script and multiple queries to make it happen. Since all of the requisite information is in the database, I don't see why I shouldn't be able to extract thei nformation I'm looking for in one query. If it helps, I have another table of employee usernames that I might be able to use in a join of some sort to isolate these timeclock records.

View Replies !
Record Paging Query
how can I split records into multiple pages and access those pages using letter wise naming. Like we have a company listing arranged into multiple pages from A to Z pages and I want to show Companies starting from letter "C" so this arrangement should allow me.

View Replies !
SQL Query - How Too Omit Record
SELECT DISTINCT `CAT`
FROM `flor`
LIMIT 0 , 30

`flor`
CAT

today
tonight
today
tonight
tomorrow

My purpose is to not include a record from the field CAT with the value:
[today]

is this possible, with the MySQL query ?

View Replies !
Run An Update Query That Updates All The Record
I have 2 table which I extract data using the query below. This works fine. What I want to do is run an update query that updates all the record that the original query returned. Code:

View Replies !
UPDATE Query - Create A New Record
Here's my dilemma. Some pitchers (all of whom, obviously, have stats in the pitchers stats table) also have hitting stats in the hitter_stats table, but some dont. So, i need something like this.

If the pitchers player_id exists in the hitterstats table for a certain year, then insert the stats into that yearly record. If there is no record for that player_id, then create a new record for that pitchers players_id. im having trouble coming up with this one,

View Replies !
Cycle Through Checkboxes
I am fairly new to PHP and ran into a problem that I am sure someone can help me out with. I have a list of email addresses that I am pulling from mySQL, and printing them in table rows with checkboxes in front of each row so that the user can select the address to be deleted from the DB when the user clicks submit button.

I am naming each checkbox "c_<email address>". The output works fine.

The problem that I am having is, how do I make PHP cycle through each of the checkboxes to check to see which one or ones are checked?

View Replies !
Query Not Reflecting Records
I have a form that submits about 30 fields or so to a mysql dbase. i have verified the functionality of entering data and storing Code:

View Replies !
Sql Query For Find All Records Have Same Id
Lets suppose I have a table like this one

idid_1id_2 date_time
110110002006-07-04 11:25:43
21021001 2006-07-04 11:26:43
310110052006-07-04 11:27:43
410310002006-07-04 11:25:43

I want to find all records have same id_1, but different id_2 and have difference in time less than 5 minutes. In this case this is record 1 and record 3. How can I do this ?

View Replies !
Database Records Query
Can anyone help me with the following mySQL code. Probably a simply solution but i cant find the answer anywhere. I have a table called news full of articles each one has an associated news_id. What i need to do is query the database and pull out the last article. Then i want to pull out the second to last article and finally the third to last article.

View Replies !
How Do You Tell If A Page View Is A Direct Hit, Iframe View, Or Other
How can one tell if a hit on a PHP page was generated from an iframe, object/img tag, or a direct hit?

View Replies !
Using Record Identifier From Select In Update Query?
Just wondering if I can get a record identifier from a query. The basic idea is to process the data in a user-specified field in a user-specified table.. and write it back without modifying any other field. So the program would go something like this:

$qid=mysql_query("SELECT $field FROM $table");
WHILE ($list($field_value)=mysql_fetch_row($qid)) {
new_field = process($field_value);

and then the tricky part - how do I write back $field to $table? If I use an update query (eg: UPDATE $table SET $field=$new_field WHERE $field='$field_value') it will update all the fields where $field is $field_value.

Is there a way of getting a (unique) record identifier from the select query and using it in the update query? Since the table is user-specified, I have no way of knowing what the primary index is.

View Replies !
Last Record Of Table Not Showing Up (3x Array Query)
I ran into some touble with my already pretty confusing project. I finally managed to figure out how I can link 3 tables together and show info from all per cell of a table..
this required a couple of while loops and it works like a charm except I am missing the last record Code:

View Replies !
Create A Query That Will Insert Each Size Into 1 Record
Seeking some help on a site i'm working on. Our company acquired a software for order processing we do. I am in the midst of trying to format it somewhat and i'm coming across a situation i'm not familiar with. In this code, there is a loop statement that adds the quantity of SM, MD, LG, 1X, 2X and 3x and displays a grand total. I am needing to create a query that will insert each size into 1 record, sorta like this:

Record1: Qty, BaseID, CustomText, Size,Price, Extended Price

THis will need to be done with each size that the user has added to the cart.I am not displaying any info now, as i am unser what is needed but if someone can point me in the right direction, it will be greatly appreciated. I will post whatever code is needed.



View Replies !
Cycle .html Files
I have been searching, and writing trying to get this script to work for about two weeks now to no prevail, and thats why I am asking you now. I started writing this script in Javascript, but I soon found out you cannot do SSI's. Here is what I have so far, and hopefully it can give you an idea of what I want from it:

<?php

$week = date(W)
$weekfile = array("class23.html","class456.html"...);


include($weekfile['$week']);

?>

Now I am trying to take that script, and make it to where it includes a new .html file each Sunday. If not Sunday then Monday wouldn't be half bad either.

View Replies !
Web Fetching Cycle Problem
I am trying to grab information from a website. I can get it to parse the first record just fine, but how can I have it cycle through all of them? Code:

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved