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.





Displaying Priorty Records And Normal Records In The One Dataset.


I have a page which displays the records from the database and uses paging to display the records in groupes of 10 per page.

I now want to be able to show results depending on the database field (display) in the database (can be set to either "full" or "limited"). If the record and the field display is equal to "full" i want to then display this record at the top of the record set and display all the fields.

If the record is equal to "limited" i want to display different results and they must show after all the records which are equal to "full". I can't output two different recordsets as i use paging and only want to show 10 records per page. Code:




View Complete Forum Thread with Replies

Related Forum Messages:
Displaying Multiple Records And Want To Be Able To Update These Records With Different Values.
I am creating a page where I am displaying multiple records and want to be able to update these records with different values.

View Replies !
Displaying Some Records Once Only
I'm building a database via mysql/php which brings back records of events. My problem is that I only want to show the Venue for the event once and then list the events for that venue. ie Code:

View Replies !
Displaying Last 5 Records
I have a database which contains the articles on the front page in it. Well, to save clogging up the front page, I would like to display only the latest 5 articles in the table. The articles have an id field which could be ordered descending, but from then on, I have no idea what to do.

View Replies !
Displaying Last Three Records
I want to display the last three records that are in a database so that I can show the latest three articles which have been posted.

When i try and do a mysql_num_rows of a query it doesnt return the last record it just returns 76 when there are 82 records in the DB.

How would I go about getting the last three article ID's posted and displaying them?

View Replies !
Displaying # Of Records In A Table
Can anyone throw me a link to some prefab code, or a tutorial on how I can get a page to display the number of records that meet a certain criteria.

example:
I have a page that stores information on audio FX. I'd like to include a feature that would let the users know how many items are in a particular section.

Player (10)
Items (5)
Weapons (0)
etc.

All help appreciated,

View Replies !
Displaying Unique Records
I've got a database table named 'sales' where each sale has these fields:

View Replies !
Displaying Records, But Not Identical Ones.
I have a table with several rows. One column is "State", where, of course, a state is listed. I'd like to query the database and list all states in the rows, but I don't want multiple instances of the same state? How can I prevent it from showing:

View Replies !
Displaying The Next/previous Records
I'm trying to stick some PHP code onto next and previous buttons to display the next / previous 10 records, then using;

$result = mysql_query ("SELECT * FROM property_1 WHERE area='$whatarea' LIMIT $limitit,10");

but if the above code and the buttons themselves are on the same page how do you stick PHP code on the buttons to do the limitit+10 and limitit-10 and also to call the page?

View Replies !
Displaying Records After 2 Days
I trying to display only records that are 2 days old so the owner of the site can preview new records before they are available to others, this is what I've got so far...
$sqlquery = "SELECT headline, news, date_format(date,'%M %D %Y') as time FROM $table WHERE date < NOW() ORDER BY date DESC";

is there a way to extend it by 1 or 2 days, i've tried the TO_DAY function but couldn't get it to work either.

View Replies !
Displaying Records In Table
I have a table that I want to display some records from my database. I have a specific spec I'd like the table to conform to, 3 cells wide.

I can get the data into a cell. But my problem is, I'd like the table to have the 3 cells fill and then have the additional data create a new rows and continue on infinately.

View Replies !
Displaying Records Via PHP/HTML
I have currently devised a way to display up to 3,000 records via PHP/HTML by using pagination techniques that stuff an entire DB query resultset into a $_SESSION object to use within pagination.

Here's my question: How good will this work when we start dealing with more than 3,000 records? Like 5,000? 10,000? 10,000+? The $_SESSION object will obviously become too large to be manageable.

What do you guys advise I do to manage this in the foreseeable future? No rush on this of course for now.

View Replies !
Displaying Mysql Records:
I wondered if anyone could offer some guidance, I trying to write a php script to connect to a database, and display the records in a table. I found the code here in a php4 text, and when I run this directly through the php intrupeter, the line Successfully connected is display and 4 as the number of rows. The database table we connect to, has three field username, firstname, surname.

When I tried a while loop, to display the data in a table. No values were displayed. Could anyone possibly demonstrate how to display the username, firstname, surname values in a basic table?

<?php
function db_connect(){
global $MYSQL_ERRNO, $MYSQL_ERROR;

$link_id = mysql_connect("localhost","user04", "password04");

if(!$link_id){
$MYSQL_ERROR = "Connection failed";
..................

View Replies !
Displaying Records That Are Less Than 30 Days Old.
I have records that are dated using date('y,m,d') when they are created.

Would like to only display records that are less than 30 days old. So, IF record is older than 30 days - do not display. Here is my code:

$arr = $db->getArray("SELECT * FROM table WHERE id = '$id' ORDER BY date ASC");

View Replies !
Displaying Records In A Cyclic Fashion
I use the following code in-order to display records based on the week day.My intention behing writing this one was to display 90 records in a cyclic fashion.(i.e, first 90 on monday, next 90 on tue and so on...)

View Replies !
Displaying Records From Text File
I have the following Code which reads in information from a text file: PHP Code:

View Replies !
Displaying Records In A Split Table?
trying to split up results of a query into a split table. example: PHP Code:

View Replies !
Displaying Database Records Over Multiple Columns
I am currently using the following to generate a table with a single column with ten entries PHP Code:

View Replies !
Sorting Arrays And Displaying Unique Records
I have built a script that scrapes a web page, parses out the HTML, and then puts the words into an array (explode).

Now I want to find just the unique values, and count how often they appear in the array... is this easy?

View Replies !
DELETE RECORDS - Database Adding New Records
iv got the database adding new records, and now I want it to display all of the records that are there buy name and id number, then i want u to be able to type in the id number of the customer u wish to delete and it shoudl delete it, sounds good buts its not actually deleting the record. it says it does, but its not doing it. Code:

View Replies !
Problems With The Listing Of Records, Editing Of Records
I'm having problems with the listing of records, editing of records, and deleting of records. I'm not sure what I'm doing wrong.

The listing script is calling the add entry script. So I add the record, the database is updated, and nothing else happens. I don't get a list of records from that table.

When I did SQL programming off the mainframe, you did a simple select statement. I'm not sure why the PHP list script is calling the add entry script. Code:

View Replies !
DNS Records
Hey everyone, I'm trying to get a DNS record of an IP using PHP's checkdnsrr() and getmxrr(). I used

echo checkdnsrr($REMOTE_ADDR);

and

echo getmxrr($REMOTE_ADDR);

but I receive an error that the PHP build does not support it, but I am using PHP 4.0.5 and in the manual, it shows that PHP 3 and 4 supports the two commands. Any help?

View Replies !
Next N Records
how do I create a "next n records" interface? I want to initially output a specific number of rows, and have a next/previous scenario where the user can click on either and scroll forward or back through the records. I'm currently outputting all rows through mysql_fetch_array: Code:

View Replies !
HOW TO GET HOW MANY RECORDS YOU HAVE IN DB
I finally discover the way how to get what I need.

Let's look to my code:

----------------------- CODE ------------------------>

$res = @mysql_query("SELECT COUNT(*) AS ToT FROM table_name");
$dato = mysql_fetch_array($res);

echo($dato[ToT]);
----------------------- CODE ------------------------>

With this code you will get how much records do you have in DB.

PS:
Whan you think that everything is over and that you are at bottom of
trying push harder to see what is under.

View Replies !
Last 5 Records
is there an easy way to grab the last 5 distinct records from an unindexed database?  (php/mysql)

View Replies !
Old Records
Would anybody know where i have gone wrong in this script?

$tm7781=date ("d:m:Y H:i:s", mktime (date("H"),date("i"),date("s"),date("m"),date("d")-1,date("Y")));
mysql_query("DELETE FROM tracker WHERE endsession < '$tm7781'");

View Replies !
3 Records Across
I have asked on this forum, but I need to know of a way to query a DB, and print the records across the screen 3 at a time. I always print downwards, but I am being asked to print 3 records, then break, 3 records then break, I am not sure how to do this.

View Replies !
Only 25 Records For Each ID
Is it possible to only collect 25 records for each ID? When I insert the 26'th record for that ID I want to get rid of the oldest record for that ID? I did it once in ASP and it looked like this: Code:

strSQL = "SELECT * FROM list WHERE ID=1"
rs.open strSQL, conn, 1 , 1

If rs.recordcount > 24 Then
strSQL = "DELETE * FROM list WHERE Date IN(SELECT TOP 1 Date FROM list ORDER BY Date)"
conn.Execute (strSQL)
End If

strSQL = "INSERT INTO list ( ID, Point, Name ) VALUES (" & _
"'" & sqllize(Request("player1ID")) & "', '" & sqllize(Request("player1Point")) & "', '" & _
sqllize(Request("Player1Name")) & "')"
conn.Execute (strSQL)
rs.Close

Is this possible in PHP, and if yes, how?

View Replies !
Next Records In Db
i have, what i suspect, is a fairly basic task to perform, it's just i'm not sure how to approach it – client side or server-side? i load in an image (filename) from the db dynamically along with an image caption. my code is outlined below:

  <!-- begin content -->
  <div class="content">
    <div class="gallery_image"><img src="images/gallery/music_sized/<?php echo $row_gallery_musicGetRecords['image']; ?>" alt="<?php echo $row_gallery_musicGetRecords['image_alt_text']; ?>" /></div>
    <div class="caption">
      <p><?php echo $row_gallery_musicGetRecords['caption']; ?></p>
    </div>
  </div>
  <!-- end content -->
my header code, accessing the db 'n what not is below:

<?php require_once('Connections/emmadalzell.php'); ?>
.......

View Replies !
Number Of Records
I want to find out how many records, but I am using LIMIT in mySQL so if set the limit to 20 and I have 56 records then it will display 20 instead of 56.

I have been using:
mysql_num_rows

What should I be using?

View Replies !
What To Do If There Are No Records In The Database
I am pulling data from the database and displaying it using the code below:

$db = mysql_connect("localhost", "root");

mysql_select_db("pyramid",$db);

$result = mysql_query("SELECT * FROM table where area='Wales'",$db);

while ($myrow = mysql_fetch_row($result)) {

echo "blah blah";

}
?>

What do I do if there are no records? At the moment it just doesn't display anything. How do I get it to display a message saying there are no records?

View Replies !
Updating Records
I am know to PHP i've been tring to do this **** for days now could someone PLEASE help me. Ok Im tring make an admin page where user can update multiple records at same time using checkboxes.Im using email as primary key.

Here is the code

**form page**

<form action="update.php" method="post">
<input type="submit" name="submit" value="Select First 10 Names">
</form>

**update.php**

<?php

if ($submit =="Select First 10 Names")
{
?>
<form method="post" action="<?php echo $PHP_SELF; ?>">

<hr size=3>
<?php

$query = mysql_query("select * from Names order by Last_Name limit 10");
while($row = mysql_fetch_array($query))

{
$first_name= $row["First_Name"];
$middle_name = $row["Middle_Name"];
$last_name = $row["Last_Name"];
$email = $row["Email"];
$photo=$row["Photo"];
?>

<table width="100%" border="0" >
<tr>
<td align=right width=50%>
<?php
echo "First Name: <input type=text name="first_name" size="30" maxlength="40"value="$first_name" ><br>
";

echo "Middle Name: <input type=text name="middle_name" size="30" maxlength="40" value="$middle_name"><br>
";

echo "Last Name: <input type=text name="last_name" size="30" maxlength="40" value="$last_name"><br><br>
";

echo "Email: <input type=text name="email" size="30" maxlength="40" value="$email" readonly><br><br>
";

echo "Photo: <input type=text name="photo" size="30" maxlength="70" value="$photo"><br><br>
";

echo "<input type="checkbox" name="email[]" value="$email"><b>Update?</b>
";

?>
</td>
<td align=right width=50%>
<?php
echo "$photo";
?>
</td>
</tr>
</table>
<hr size=3><br>
<?php
}
?>
<input type=submit name=submit value="Update Enteries">
<input type=reset>
</form>
<?php
}
if ($submit=="Update Enteries")

{
if (is_array($email))
{
while (list($key,$value) = each($email))
{

$query= mysql_query ("update Names set
First_Name = '$first_name'
Middle_Name= '$middle_name'
Last_Name='$last_name'
where Email='$value'");
}
}
}
?>

View Replies !
Need Help With Deleting Records
I'm trying to add a link on the display of a record to delete that record.

The main part of the record is stored in pw_event, then there are several rating fields for that record stored in pw_rate, and there is also several records for the first record stored in pw_whois.

I need to have a link that will deleted everything for that record in all three tables.

Here is my display script:

PHP Code:

View Replies !
Retrieving Records With Between
I am trying to convert my asp website to php. So far so good, but I am having a problem with my SQL Statement that needs to us the Between. Here is what I am using:

$sql = "Select * From tblTrack Where DateEntered Between $start and $end";

the vars start and end come from the same form. I don't have a problem when I hard code the dates, but when I use the variables, it won't retrieve anything.

View Replies !
PHP/MySQL Records Per Row
Is there any way to have the records pulled from a mysql database display like this in a table:

record1 | record2
record3 | record4

etc: I've been thinking about this for about three months and have yet to come to a good solution.

View Replies !
Inserting Records
I'm trying to insert as many as records as possible but less than 100 into a table. First, i get the count inorder how many to add and then depending on the count, i get so many blank form fields to enter. Now, I noticed something really strange.

1.Only the last entered record is inserted into the table.
2.For example, when I type a name, Let us assume "WORLD", only w is inserted into the table and the rest is not.It is the same with all the form fields.whether, i'm trying to enter text or a number,only the first character is inserted.This sounds weird. Could somebody pls tell me why is this peculiar behaviour Here is the code:

View Replies !
Insert Records
When I try to insert a records in the database "socios", it doesn't inserted at all. Code:

View Replies !
Different Hyperlinks To Different Records
I'm displaying few records from a mysql table - pretty straight forward one. For each record i display on the form, i want to add a link to it.so, each link would display a different page(an html). PHP Code:

View Replies !
How Do You Sort Records?
I have a db table "person" that I can sort by title, first_name,
last_name, or city with no problems at all because "title",
"first_name", "last_name", and "city" are columns in the table.

The requirement is to ALSO sort by department NAME. Problem is, I
can't do that in the "person" table because the column is
"department_id" which is a foreign key constraint to the department
table.

How do I sort the person records by department_name based on this?

I am using PHP 4.3.2 and MySQL 4.0.10

Now, second problem and even more of a problem:

The requirement is to ALSO sort by state NAME and country NAME. The
fields "state" and "country" in the "person" table contain only an
abbreviation of state and country; the corresponding full name of each
state and country are found in respective XML files in /xml/state.xml
and /xml/country.xml

View Replies !
Compare Records
is it possible to write a query to compare records in 2 tables, like if the number of records in the  2 tables are equal the query should return 1 if not equal the query should return 0. this can also be done in php like, get the number of records from one table and get number of records in another table, compare it and do the operation. but i wanted to know if its possible to do the compare records using the query itself.

for example, if one table has 5 records, this should be compared with another table, if this table has 5 records, then the result of the query should be 1 else 0. if i use joints, it will return all the 5 records. so not sure how to make this in a query. anyone have any idea ?

View Replies !
Display Records
I want it to display all the records meeting the criteria specified in the script, but it only shows one records and should show about ten. any thoughts or pointers to get it to display more than one record. Code:

View Replies !
DESC Records
i want to make all the records be shown in a decending order, i've tried using:
$sql = 'SELECT * FROM `repair` ORDER BY `repair` . `id` DESC';

View Replies !
Records Won't Delete
mysql_query("DELETE FROM guestbook WHERE id = '$recnum'"); It works fine on my local server but it doesn't delete records on the remote server. any ideas?

View Replies !
Count Records
How can I count how many records are in a table that match a news_id? I have this at the moment, but it doesn't seem to work. Code:

View Replies !
Retreiving All Records From Sql Db
IM trying  to get cost values out of the db with a specific ID which is assigned to an item ID but i only get the last record in the database.

$lala = mysql_query("SELECT `cost` FROM `table` WHERE `ID` = '1'");
while ($la = mysql_fetch_row($lala)){
$start = 0;
$overall = $start+=$la[0];
}

echo("$overall");
...

View Replies !
Return Last 3 Records
I want to return the last 3 records added to my table called towns. 

sql = "select * from towns limit 3"

This only returns the first three rows, I want the last 3.  My primary key field is townID.

View Replies !
Getting ALL My Records To Display
In this code, almost everything is working perfectly, but for my second query, I have six records that I want displayed in their own table like I have. I know that a loop would probably work, but I am just really not sure how to go about this. I would like the code to display a table of each of the records. Code:

View Replies !
Can Session Id Be Same For 2 Records ?
can i confidently believe that a session id will be unique for all the users even if there are lakhs of  users ?

is there any possiblility that the session id can be same for 2 records ?..

i want to send an email to the user to verify their account after their registration. so i am sending the session id in the get and once they click that link it will take to a page where it will compare the session id with the one that is stored in the database.. is this the correct way?

View Replies !
Deleteing From Records
Ive created a mailing list using php3, and i'm trying to make an unsubscribe, so far i have it set up to mail me with the email of the person(s)  wishing to unsubscribe, and i have to do it manually. Code:

View Replies !
Selecting Records
i need some code that will select all the records in between two dates based on someone entering in these two dates. problem is i have no idea how to code it as i dont fully understand the coding behind it. here is the code

<form name="getdates" method="post" action="">
From:
<input name="date1" type="date">
To:
<input type="date" name="date2">
<input type= "submit" name="datesbetween" value="Get Dates">
</form>
<?php
$date1 = date(d,m,Y);
$date2 = date(d,m,Y);

if ($called){

return false
else
return true
$date = mysql_query ("SELECT * FROM calls WHERE calls.called ");
}...

View Replies !
Multiple Records To One
I have a database which comprises of a routes system.. some basic fields like

ID | Routenum | Departure | Destinations | Deptime | Arrtime | Comments

However, I have multiple routes where the Departure and Destination are the same, only the times are different. How could I make it so that only one appears on the routes list, instead of having about 5 similar entries?

View Replies !
Priority Records
I have a system in place that allows users to set call status to several different states,

1. No Answer
2. Not Interested
3. Not Eligible
4. Interested to Confirm
5. Send a Leaflet
6. Please Call Later
7. Interested and Confirmed

i also have a page that auto allocates leads when the user as run out of them.

What i want to do i make it so that and time a request is sent to the db for more leads it, takes all callbacks as priority and brings them out for the user to call straight away, instead of them having to navigate to the correct area.

View Replies !
Fetch The Records
i have a mysql table.it has 2 fields . 1.register_number 2.registered_date

values
333333----2007/08/21
245678----2007/06/30
123123----2007/09/20
123222----2007/09/21
125553----2007/09/22

i have select box on a page and it's option values from january-december. when i select the month from select box and press submit button,it should fetch those records that are registered in that particular month. i just need the sql query logic to fetch the records of that particular month.

View Replies !

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