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




Grabbing Specific MySQL Records


I have set up a target page to pull information out of a mySQL database to populate the page. The problem is that it is only pulling from the first record and not the record specified. What do I have to do to pull from a specific record? I am using Dreamweaver MX to administer the site on WinXP using PHP if that information will help.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Control Access To Specific Mysql Records For A User
I am just trying out a php form, when posted submits data to database. The system is we allow everyone to submit the form. As administrator I can view and edit the records. But whoever submits the form should be a registered user and he should be able to only view his records but not edit.

Need Help Extracting Specific Records In An Array
I am using a pc of code that is as follows:

while ($row = mysql_fetch_array ($result))
{
echo "user_id: ".$row["file_name"]."<br>";
echo "user_id: ".$row["file_author"]."<br>";
echo "fullname: ".$row["file_keywords"]."<br>";
echo "fullname: ".$row["file_description"]."<p>";
}

This will extract all the data from the records that have been stored in $row.

The question I have is how to take out slective informtion? Let's say I have a complete $row array (40 finds) but only want to show the first 3-6 records. How do I access hose specific miages?

Php Grabbing From Mysql
I was trying to use PHP to grab from a mysql database (a wordpress one, for those who are curious). I feel like my code makes sense, but it isn't outputting anything.

<?php
   $titles = mysql_query("SELECT * FROM `wp_posts` LIMIT 0, 3");
   $realtitles = mysql_fetch_object($titles);
   echo $realtitles;
?>

Getting Data From A Specific Row With Mysql
I'm makin a member's area on my site with sessions, as they log in correctly the username is stored as $_SESSION['user']

what I can't work out, is how to access my table and extract data from just the row that has that username, eg

SELECT * FROM table WHERE username=$_SESSION['user']

as I'm trying to make the users be able to edit profile, upload pics etc... any idea what I'm doing wrong?

Non Case Specific Mysql
anyone know how to do a search... say for '%$search%' that would not be case specific?

Grab Data From Mysql For Specific Date
I am trying to make some code with PHP and MySQL for displaying data from table corresponding to current server date (only field with date corresponding to server date will show on webpage). PHP Code:

Select Specific Phrase From MYSQL Database
I am working on a World of Warcraft guild's website and I am trying to create a page where players can select different kinds of gear, i.e. the gear with the most Stamina.

All the player's items are stored in the database and every item have a field in the Items-table containing the item's tooltip. This could look something like:

Boots of the Nexus Warden
Soulbound
Feet Cloth
97 Armor
+27 Stamina
+17 Intellect
Durability 35 / 35
Equip: Improves spell hit rating by 18.
Equip: Increases damage and healing done by magical spells and effects by up to 21.

I then want to select the item with i.e. the most Stamina for all the different slots; Head, Chest, Legs etc.

If I write this:
$query = mysql_query("SELECT substring(item_tooltip, LOCATE('Stamina', item_tooltip)) AS maxor FROM roster_items WHERE member_id = &#3962;'") or die(mysql_error());

It returns the following:
Stamina +17 Intellect Durability 35 / 35 Equip: Improves spell hit rating by 18. Equip: Increases damage and healing done by magical spells and effects by up to 21.

But I want for it to show the leading characters also (in this case "+27 " before "Stamina") and then not show anything else after the phrase "Stamina". So it shows "+27 Stamina" and nothing else for the above mentioned item. How do I accomplish this?

And then, secondly how do I then get it to show only the item with the most Stamina after it selected the above?

Hope this makes any sense.

I've tried to search these forums and found something a little along the lines of my problem but haven't been able to adjust them to my needs and I therefore need your help which will be greatly appreciated.

MySQL - Select Specific Row Based On Unique ID
I am building a photography website in html, and have a pre-formated table in which i want to put a thumbnail pic, the date of the pic, the name, and links to different sizes of the image. In a MYSQL database i have a table with four columns: ID (INT, auto-increment), ImageName (VARCHAR), FileName (VARCHAR), Date (VARCHAR).

I'm just getting started with PHP, and i want to either:

have the information automatically inserted into my pre-made table via a php loop command

or

write a script which will allow me to only enter the id# and will subsequently insert the name and the date into my table, and which might display the image of the filename.

I hope this is clear enough, I've bought quite a large book on PHP and have been browsing forums in an attempt to learn, but i can't find an example that inserts it into a pre-existing table.

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.

How Do You Delete Records From Mysql
Could someone please show me how to delete records from mysql. Maybe even an example in a loop that deletes records based on a criteria.

How Many Records Can MYSQL 4.1.14 NT Via TCP/IP Can Hold?
how many records can MYSQL 4.1.14 NT via TCP/IP can hold?

how many records per table can MYSQL 4.1.14 NT via TCP/IP can hold?

how many records in a table can MYSQL 4.1.14 NT via TCP/IP can hold given the table has a field Primary key - BIGINT(20) autoincrement?

need your opinion..Here are the facts:

MY system is an internal one. My Server--Is only a Desktop.. Celeron 2.8 Gigahertz, 40Gig Baracuda HD, 512 MB memory.. And it serves an average of 20 users a day and it also serves me for my system development..The average records inserted per month on mYSQL is 10,000 records..We foresee that system would be used for about 10 years.

Counting Records In MySQL
I've been trying to write a page that checks the database and counts the number of records and if the number is less than 3000, it loads page X, but if the number is equal to 3000, it loads page Y.

I know this should be a simple if/else statement but it's the checking and counting that I cannot get to work. 

How Do Iterate Through MySQL Records And Displat Them?
Basically I have a page where a person can choose from a list of stories posted by people, or they can choose to submit their own. I've managed to do the page where they can submit their on. The way i did this was to set up a mySQL database, and table in the database called stories. I then made an id (primary key), author, title, body and date field in the table. When the user submits their story its given an id (which increments on each submition) and their author, title and body fileds are sent to the database. The date key is automatically stamped in.

Ive also managed to have the submition page display what they submitted by using the count(*) function, their story would be the last to be submited , so it pulls that from the database and displays it.

Now what I want to do - on the page where they can pick a story, is have the page connect to the database and grab each record and display the author and title on the page next to a radio button. And have the id for the story in a hidden field or variable so when the user to chooses a particlar story it uses the id to grab the story from the database.

So how do iterate through all the records in the database, and display each one?

Problems Updating Records In MySQL With PHP
Sorry to ask what is probably a simple answer, but I am having problems
updating a table/database from a PHP/

PHTML file. I can Read From the Table, I can Insert into Table/Database, But
not update. Here is a copy of the

script I am using. I do not know what version of MySQL my host is running
nor do I have Shell Access to it. I

would like to setup a script so my website users can update thier records
without my intervention.

Also you may send replies to stevennyoung@yahoo.com

Begin Script

<?php
$db = mysql_connect("localhost", "username", "password");
mysql_select_db("databasename",$db);

if ($id) {
if ($submit) {
$sql = "UPDATE tablename SET
EMail='$EMail',Username='$Username',Password='$Pas sword',Item=

'$Item',Price='$Price',URL='$URL' WHERE Username='$Username'";
$result = mysql_query($sql);
echo "table Updated.";
} else {
// query the DB
$sql = "SELECT * FROM tablename WHERE Username='$Username'";
$result = mysql_query($sql);
$myrow = mysql_fetch_array($result);
?>
<form method="post" action="<?php echo $PHP_SELF?>">
e-Mail Address:<input type="Text" name="EMail" value="<?php echo
$myrow["EMail"] ?>"><br>
Username:<input type="Text" name="Username" value="<?php echo
$myrow["Username"] ?>"><br>
Password:<input type="Text" name="Password" value="<?php echo
$myrow["Password"] ?>"><br>
Item:<input type="Text" name="Item" value="<?php echo $myrow["Item"]
?>"><br>
Price:<input type="Text" name="Price" value="<?php echo $myrow["Price"]
?>"><br>
Item URL:<input type="Text" name="URL" value="<?php echo $myrow["URL"]
?>"><br>
<input type="Submit" name="Update" value="Update table">
</form>
<?php
}
} else {
// display list of articles
$result = mysql_query("SELECT * FROM tablename",$db);
while ($myrow = mysql_fetch_array($result)) {
printf("<a href="%s?Username=%s">%s %s</a><br>
", $PHP_SELF,
$myrow["Username"], $myrow["Item"], $myrow

["URL"]);
}
}
// Close DB Connection
mysql_close()
?>

PHP Mysql Outputting Records Repeatedly.
I have not messed with php/mysql in a while and have come up with a
problem I have run up against before but cannot remember the solution.
See the following page:

Very Slow MySQL SELECT Query After 11 Records
I have a very weird problem

I moved my database to new IIS 6.0 + PHP 4.3 + MySQL 4.0 setup. I tried to check with myphpadmin if everything works fine, but I couldn't browse my table (125 records). I used SELECT option and found out that SELECT query up to 11 records is ok, but after that, even if I choose to limit query to 12 records, it just hangs.
I tried selecting from the beginning of the table and from the middle - same thing, but when I run query localy on mysql console, everything works fine

How Do I Prevent Mysql From Printing Redundant Records?
I have a very urgent question. I am using php and mysql.
Say I have a database full of names and email addresses. I want to do a query that when you type in the name or partial name, mysql will only show a name once, even if it is in the database 200 times. Then I want to click on that name and have mysql show the 200 email addresses associated with that name (which I know how to do). See below:

Inserting Master-detail Records In Mysql
how I can insert a master-detail record in mysql? I use an auto-increment key, but I don't know how I can find that key for inserting the detail records, I tried to make a 'highest-key' function with 'select MAX(field)...' but in php it gives the wrong key (in mysql it gives the right one).

Changing Data In Objectified Mysql Records
I am using this very slightly modified function found here:
http://us2.php.net/mysql_fetch_object
to make mySQL rows into objects of type $classname:

// This takes db result rows and makes real objects of $classname type
function &buildObj($result, $classname) {
while($row = mysql_fetch_assoc($result)) {
if ($row === null) return null;

/* Create the object */
$obj =& new $classname;

/* Explode the array and set the objects's instance data */
foreach($row as $key => $value)
{
$obj->{$key} = $value;
}
$objs[] = $obj;
}
return $objs;
}

This is called by a retrieve: function:

function retrieve($where) {
echo $query = "SELECT * FROM $this->table WHERE " . join(' AND ',
$where);
$result = mysql_query($query);
$rows =& buildObj($result, get_class($this));
mysql_free_result($result);
return $rows;
}

The problem I am encountering is that if I do this in my script:

$listing = new Listing;
$listings = $listing->retrieve(array('row > 1') );
foreach ($listing as $aListing) {
$aListing->address='xxxxxxxxxxxxx'
}
foreach ($listing as $aListing) {
print_r($aListing);
}

The value in $aListing->address is unchanged.

However if I do this:

$listing = new Listing;
$listings = $listing->retrieve(array('row > 1') );
foreach ($listing as $aListing) {
$aListing->address='xxxxxxxxxxxxx'
$newArray[] = $aListing;
}
foreach ($newArray as $aListing) {
print_r($aListing);
}

I see the update values in $aListing->address .

Break MySQL Records Into CSS Columns Automatically
I'm making a page of links, each assigned a category. There are two tables - "favourites_links" and "favourites_categories". This is how the links currently appear:

Category 1 Name
Link 1
Link 2
Link 3

Category 2 Name
Link 1
Link 2
Link 3

What I want to do is break my page into columns. Basically, set a number of columns (e.g. 3), count the total records, and work out how many records to show per column. Each column should be enclosed in a <div class="column"> wrapper, which floats to the left. Code:

Having Trouble Looping Through Records In A MySQL Table
I'm having some trouble looping through the records of a MySQL table using PEAR DB. Here is my code:

$navigationSql = "SELECT * FROM nav";
$navigation =& $db->query($navigationSql);
while ($navigation->fetchInto($nav)){
define("NAVIGATION", "<a href="$nav[2]" target="$nav[3]" title="$nav[1]">$nav[1]</a><br />"); }

The when I enter:
print NAVIGATION;

into any of my PHP scripts it should loop through the stuff in table named nav, but it is only displaying the first record and so far everything I've tried does not seem to make it loop through all of the records in the table and I can't figure out why not.

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:

Can I Convert MySQL Db Records Into Microsoft Word Documents?
i found the solution to export
file from mysql db into *.csv. but is there anyway to convert the
contents into *.doc and save in my webserver and providing a link for
the end users to download the word file?

FYI, the database records are obtained by end users submitting the
forms themselve and i saved it in my db...

MySQL Inserting Into Multiple Tables Linked Records
Using MySQL can anyone tell me how to most efficiently insert a collumn
in 'table1' retrieve the id from this record and insert mutliple
records into 'table2' with a collumn for the id in 'table1' which links
the two recordsets

How To Access And Modify And Add Records In MySQL Table From A Windows Client?
The MySQL table is located in a Linux Server OS, so I need the
information from that table for updating Paradox tables in Windows OS.
If a PHP program in the Linux Server can save a file with the
information I need, can I make a PHP program in Windows OS to get the
saved file or even better, to access the table in the Linus Server OS?...

Count,sort,diplay Number Of Records In MySQL Table
I am designing a search engine using PHP/MySQL and I am logging all search terms into a MySQL table. I was wondering how I count the number of occurences of a term in the table, and then sort and display the terms in descending order. For example, if the column in my table with search terms looked something like this:

clothes
casinos
clothes
homes
homes
clothes

How can I count and order the records so that I can display according to how many times they appear, like so:

1. clothes(3 entries)
2. home(2 entries)
3. casinos (1 entry)

Need To Update Multiple Mysql Records With A Single Form Submit
I have a wish list like a shoping caty based on a mysql databse where i retrieve records with php I need to update the quantity which is in a text fields :

input type = text name = quantity[] value = $quantity
input type = checkbor value = $id name = id[]

I need to update quantities based on the primary id represented with id with a single submit.

Automatic Delete From MySQL Database Table Expired Records?
I have a question . . .

how can i delete from MySQL database table automatic expired records ?
?

One think is to make a service that deleting the expired records . . .

Any other method ?



Sending People To Specific Pages That Are Coming From Specific Pages...
I want to show some specific pages to people that comes to my site from
specific urls, I know the variable $_SERVER['HTTP_REFERER'] will be
used but how?

For ex if the visitor comes from a site that is like:

I want to send this person a specific.php . I used below code but not
worked:

<?php

if($_SERVER['HTTP_REFERER'] == "www.cominghost.com" ||
$_SERVER['HTTP_REFERER'] == "cominghost.com" ||
$_SERVER['HTTP_REFERER'] == "www2.cominghost.com"){

// Specific page html goes here

}
else
{
header("Location: index.php");
}
?>

This code not worked for some cases like if the visitor comes from
http://www.cominghost.com/account/targeturl.php or
http://cominghost.com/account/targeturl.php Ok I know the if statement
not working but How?

Reading An Array Of Records From MYSQL Then "Save As" Them Back As Copy
Hi all,

Ok here is what I want to do then I will show you what I have. I have some records in a MySQL DB that I want to store in an array and then immediately copy them back where the only thing that would change would be one field - the date. So here is my table:
-------------------------------------
|userName | date | value |
--------------------------------------
| theDano | 200005 | 123 |
--------------------------------------
| theDano | 200005 | 345 |
--------------------------------------
| theDano | 200004 | 678 |
--------------------------------------
| joeUser | 199908 | 897 |
---------------------------------------

So if I am querying for the user "theDano" on a specific date (format yyyymm) in this case 200005 (year 2000 month of May)

Here is my array to query all records to fullfill this request:

if ($update=="future")
{
if ($month!="01")
{
$db = mysql_connect("localhost", "dbuser");
if($db)
{
mysql_select_db("dbName",$db);
$result = mysql_query("SELECT * FROM tableName WHERE userName = '$userName' AND date = '$date' ORDER BY value DESC ",$db);
if ($result)
{
$num=mysql_numrows($result);
$i=0;
while($i < $num)
{
$userName = mysql_result($result,$i,"userName");
$value = mysql_result($result,$i,"value");
echo "<tr>";
echo "<td width=Ê×'>" . $userName . "</td>";
echo "<td width=ï`'><div align='right'>" . $value . "</div></td>";
echo "</tr>";
++$i;
}
}
}
}
}

Now I want to take the array of records queried which was:

| theDano | 200005 | 123 |
--------------------------------------
| theDano | 200005 | 345 |

and copy them to look like this back into the database:

| theDano | 200006 | 123 |
--------------------------------------
| theDano | 200006 | 345 |

so you can see that the only thing changed was increasing the month by one. Would seem simple to most but I am having a tough time wirting the code to read the array and increase each date value by "1".

Thank you in advance for anyone that replies. )

Dano

URL Grabbing
I'm trying to figure out how to capture the entire contents of the current page's URL Address/Location. I want to capture this so as to create a link in a 'downstream' page which allows me/visitor to get back without using the 'Back' button or Javascript History(?).

Grabbing Img
Im new and total lost at how to grab the url between the src="" from a webpage and replacing the ../ or whatever with the full domain name.

Grabbing Mac Address?
Is there a way to grab a person's mac address via php? i was talking to a friend who does this for a living, he doesnt know how, perhaps someone can tell me if its even possible?

I could use ips, but mac's are truely unique. now mostly isps have routers and gateways, so you can have 100 people on your site with the same ip, so i guess using macs is one way to determine their uniqueness.

Basically i'm thinking efficiency and speed, mac's would be the way to go. i know i can try ip's and cookies, would probably work the same, little slower i think.

Grabbing Only First Var From Results
I'm working on a calendar program that I inherited from a sick Webmaster somewhere in the world. Below is part of the code that chooses and compares dates to print on the calendar. The part in bold is what I think is going to be the key to solving my problem, I just don't know how to go about it.

The 'dates' column for a record in the 'programs' look like this: &62&74&84&90, etc.

Each number represents a date with more details in the 'dates' table.
Echoing out $datenum will give one number like &#3963;'. The problem is I want only first date and to ignore the rest per record. The SQL looks like this. Is it possible to only get the first search result of date per record?

foreach ($chosen_dates as $c) {
if ($c['day'] == $day_num) {
if ($section == false) { // This runs for printing courses and not programs
$coursenum = $c['coursenum'];
$name = mysql_query("SELECT name FROM courses WHERE keyword='$coursenum'");

$name_row = mysql_fetch_object($name);
// if there are courses for this $day_num

print "<p><a href='course.php?index=".$c['coursenum']."'
";

print "title='".$c['stime']."-".$c['etime']." ".$c['section']."'>".$name_row->name."</a></p>
";
}
else { // This runs to print programs and not courses.

$datenum = $c['datenum'];
echo "Datenum=$datenum";

$date_search = mysql_query("SELECT num, dates, category FROM programs WHERE dates REGEXP '&$datenum&'");

$date_found = mysql_num_rows($date_search);
//echo "Number of dates found = ".$date_found;

if ($date_found > 0) {
while($row = mysql_fetch_object($date_search)) {
//echo $c['section'] ." ";
//echo "cat= ". $row->num;
foreach($isPrinted as $printed){
if(!in_array(array('section'=>$c['section'], 'courseNum'=>$row->num), $isPrinted)){
print "<p><a href='program.php?index=".$row->num."'
";
print "title='".$c['stime']."-".$c['etime']." ".$c['section']."'>".$row->category."</a></p>
";
$isPrinted[] = array('section'=>$c['section'], 'courseNum'=>$row->num);
break;
}

}
}...

Is there such thing as maybe using a LIMIT with this kind of SQL statement? The one above is:SELECT num, dates, category FROM programs WHERE dates REGEXP '&$datenum&

Could you use something to the effect of:
SELECT num, dates, category FROM programs WHERE dates REGEXP '&$datenum& LIMIT 1?

Headline Grabbing
i started a local news site for my college and it has a feature of grabbed headlines from another news site. the problem is that the other newssite does'n have a backend for it's headlines so i tried to parse it.

i was kinda confused about ereg,eregi,and preg_match_all so i kinda mixed and math them, yknow trial and error approach. Code:

Grabbing Urls
user lands on page with info from url. ie: /page.php3?123456

How do I retrieve the value and place in a variable? ie: $reffString = ??'

Grabbing All Variables
I just installed amember pro for a client and i was wondering how i can display all the POST/GET variables that it generating for logged in users?

Grabbing Urls
Is there anyway of me grabbing the previous link the user has been on ? Say for example the user was on www.awebsite.com and then clicks my link through that site, is it possible for a script or something to grab the www.awebsite.com url ?

Grabbing The Time, For GMT+10
Whats the most simplest way to use the time() function to grab the current time in the GMT+10 timezone?

Grabbing Script
I have this php script pasted below which grabs certain tags from a document and pastes it so you can print it out. What I need to do is have a form that people can fill in the address of the website they want to grab and have it return those results. Code:

Grabbing Id3 Tags From Mp3's
how I'd be able to use php to get the id3 tag from mp3 files?

Grabbing Content From Google
i need a simple script what reads the sentence:

"Searching 3,083,324,652 web pages"

from google.com and prints out only:

3.083.324.652

Grabbing Standard Input
You know how you can send input to a perl script and grab it by: $variable = <>;

Is there a way to do it in PHP? I have looked on the site, I have searched the forums, can't seem to find it.

Grabbing Part Of A Subdomain
I want to grab the first part of a subdomain

ie  rabbits.mysite.com

i want to grab the word rabbit and put it in my page title how do i do this?

Sending And Grabbing Two Varibles
I send one variable to next page like this:

echo "<td><a href="/Product/Member.php?ID=".$MemID']."">".$row['MemID']."</a></td>";

I catch on the next page like this:

$MemID=$_GET['MemID'];

can any one help me how can I send and catch 2 variables...

Pcntl_fork & Grabbing Multiple URLS
I would like to be able to open multiple Web sites simultaneously. I know that some programming languages support opening multiple files, for example, C++. Is there a way todo so in PHP, perhaps using pcntl_fork or some other method?
Ideally, I would like to be able to open up to 30 plus Web sites using a query string.

At the moment, it takes 5 to 8 seconds for each Web site to open using fopen, and then to read so me data from each
site using fread.

Need Help In Grabbing Frame From Video File ?
I want a PHP script that can grab 1st frame of video. video can be .FLV, .MOV, .avi can you send me PHP script ASAP?

Grabbing Data From A Table And Displaying It
I'm grabbing data from a table and displaying it but I want to to spand out into multiple pages...I got it all setup but when I click on the next link nothing happens... I got it setup at "3" right now just for testing..I have 5 entries in the database.. anyways could someone help me out? here is the code:

<?php

// Get connection info
include "../connect.php";
// End connection info
if(!$rowstart) $rowstart=0;
// Start database select
$result = mysql_query(
"SELECT * FROM links WHERE notactive='$notactive' order by date desc limit $rowstart,3"); //Select Database
$result2 = mysql_query("select * from links");
if (!$result) {
echo("<P>Error performing query: " .
mysql_error() . "</P>"); exit(); }
// Display the text of each host
while ( $row = mysql_fetch_array($result) ) {
if ($notactive = 1) {
echo ("<table width=500 height=57 border=0 cellpadding=0 cellspacing=0>");
echo ("<tr>");
echo ("<td align=left valign=top><strong>" . $row["name"] . "</strong></td>");
echo ("</tr>");
echo ("<tr>");
echo ("<td align=left valign=top>" . $row["desc"] . "</td>");
echo ("</tr>");
echo ("<tr>");
echo ("<td align=left valign=top><a href=" . $row["url"] . ">". $row["url"] ."</a></td>"); }
echo ("</tr>");
echo ("<br><br>");
echo ("</table>");
}
if ($rowstart>$numrows)
{
echo "<A HREF=$php_self?rowstart=rowstart-3>";
echo "< Previous Page</A>";
}
echo "|";
$numrows=mysql_num_rows($result2);
if($rowstart+3<$numrows)
{
echo "<A HREF='$php_self?$rowstart=rowstart+3'>Next Page></A>";
}
?>

Grabbing Data From A Table And Displaying It
I'm grabbing data from a table and displaying it but I want to to spand out into multiple pages...I got it all setup but when I click on the next link nothing happens... I got it setup at "3" right now just for testing..I have 5 entries in the database.. anyways could someone help me out? here is the code:

<?php

// Get connection info
include "../connect.php";
// End connection info
if(!$rowstart) $rowstart=0;
// Start database select
$result = mysql_query(
"SELECT * FROM links WHERE notactive='$notactive' order by date desc limit $rowstart,3"); //Select Database
$result2 = mysql_query("select * from links");
if (!$result) {
echo("<P>Error performing query: " .
mysql_error() . "</P>"); exit(); }
// Display the text of each host
while ( $row = mysql_fetch_array($result) ) {
if ($notactive = 1) {
echo ("<table width=500 height=57 border=0 cellpadding=0 cellspacing=0>");
echo ("<tr>");
echo ("<td align=left valign=top><strong>" . $row["name"] . "</strong></td>");
echo ("</tr>");
echo ("<tr>");
echo ("<td align=left valign=top>" . $row["desc"] . "</td>");
echo ("</tr>");
echo ("<tr>");
echo ("<td align=left valign=top><a href=" . $row["url"] . ">". $row["url"] ."</a></td>"); }
echo ("</tr>");
echo ("<br><br>");
echo ("</table>");
}
if ($rowstart>$numrows)
{
echo "<A HREF=$php_self?rowstart=rowstart-3>";
echo "< Previous Page</A>";
}
echo "|";
$numrows=mysql_num_rows($result2);
if($rowstart+3<$numrows)
{
echo "<A HREF='$php_self?$rowstart=rowstart+3'>Next Page></A>";
}
?>


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