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.





Display Records From A MYSQL Database On Multiple Pages.


I am trying to display records from a MYSQL database on multiple pages. I get the following error when I attempt to display the results

mysql_fetch_array(): supplied argument is not a valid MYSQL result in

c:intentpubwwwrootprogeneefsires1.php on line 238

The code is shown below. I am including a file called class.pager.php for page numbers (author: Tsigo) and this part works fine.

/* Now we use the LIMIT clause to grab a range of rows */
$result = mysql_query("SELECT sireid, sirename, sirethumbpic, comment_1,comment_2,comment_3 FROM beef".$start.", ".$limit);




View Complete Forum Thread with Replies

Related Forum Messages:
How To Display Mysql Database Information In Multiple Pages?
how to display mysql database information in multiple pages? i would like to display all my member with consist of 400 people and i wan it list in mulitiple pages, and contain a "delete tick" for me,and when i click the member, can redirect me to member detail imformation. it just similiar to email pages of yahoo inbox.

View Replies !
Display Results From A Database On Multiple Pages
I am new to PHP and Mysql but am really determined to learn these techniques. I have some script that reads and displays results from the databse onto a page. However, I really wish to limit the number of results that are displayed to 10 per page and then have the next/privious links under the results. With these results, the results under the email field should be hyperlinked so that the person viewing the results should double click on the email link and send the person an email. How can i do that? I have to learn this technique.

The code is:-

View Replies !
Display 10 Records Per Page And Then Display Links To Next Pages
I have been trying to display 10 records per page and then display links to next pages etc but I can't seem to get it to work. Code:

View Replies !
Display Number Of Records Into Pages
we are using oracle database, Oracle Select statement is not supporting the LIMIT , Is there any other way to display records into pages.

View Replies !
Sort Pages Of Records From Database
When I sort dates from my sql database, the records sort all in one time.I would like to sort only 20/25 records and after to clik a button and sort other 20/25 records and so on.

View Replies !
Grabbing Data From A Table And Display On Multiple Pages
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>";
}
?>

View Replies !
Display Results From Text File In Multiple Pages
i use a string, eg "&&&" to mark pages in a text file. i use $count to count the above string. how can i display the contents of this file in multiple pages (by identifying the above string or any other method)?

View Replies !
How To Display Data From Database In Different Web Pages?
When we get data from database by use mssql_query(),suppose the data is very large ,it has many rows, and we want display the data in different web pages like many search engines do, my question is how to do that using the same result without call mssql_query() again?

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 !
Delete Multiple Records In The Same Database Querie?
I have some code that deletes records from the database, in a loop. However its prety inificient as it makes a seperate database call in every loop whcih is slow. PHP Code:

for ($i=0; $i<count($idarray); $i++)
          db_query("delete from clicks where id='$idarray[$i]'");

Is their a more efficient way of doing that? It is posible to delete multiple records in the same database querie?

View Replies !
Display Records In Php/mysql
i have the mysql database with the name "wwwgosc_ton" and table with 17 field by the name "general". i want to dispaly all the records with 3 to 4 fileds and link each row to detail of the full field of that perticular records. Code:

View Replies !
Multiple Mysql Records
I am trying to develop a form which has the user inputing data in a columnar format. Each column has multiple fields (one for each row) there are 12 columns, I was able to submit to MySql database the first column fields. All subsequent columns would be the same field inputs but the values could be different. I need each column to be submitted to the database as a seperate record by using only one form submit.

View Replies !
Using PHP & MySQL To Display Web Pages
I am a real novice to php and MySQL, with about a week's worth of
reading and self tutoring. I have an urgent need to publish a
database of information and need some guidance on how to do this.

This question might be more suited to a MySQL newsgroup, but since php
and MySQL seem to have become almost married to one another, and since
getting the data out and displaying it is where my problem seems to
lie, I thought I would start with this php group.

The problem is I can not figure out how to put information into a
MySQL database and get it out and correctly dislay it for the web.
More correctly I have two types of data I need to get in and out.

1. I have some web page content, not inlcuding borders, that is in
html format. So I have tried saving the html code, which looks
exactly like the code when you "view source" on a web page, into MySQL
and getting it out. I can get it out, but I have not figured out how
to make it act like html, i.e. to be interpreted by the browsers.
Instead it comes out looking exactly like html code. It is not being
interperted by the browser.

2. I would prefe instead of typing in html code for the content of a
page to type in instead the text, tables, lists, etc. Here is where
my problem lies, how do I input to MySQL relatively simple web pages
that may have a table, a list, some links, a picture?

3. How do I call up and use the data from MySQL an dget this to
display for the web?

By the way, I have been learning css, so I would like to use this if
possible. If not, i.e. if the formating mechanism for getting content
into a database precludes having it formattted by css on the
publication sie, then that is ok. I can live with that.

View Replies !
Inputting Multiple Records At Once To Mysql Via Text Box
I was wondering if anyone can point me in the right direction. I wanted to create a text box, as seen in some scripts, where you input various fields of information, separated by commas and the script inputs those fields into the db.

View Replies !
Select Multiple Dates' Records From MySQL DB
I need to select multiple records from a MySQL DB based on one date value that I get from a form.

When I get the date from the form I need to get the values for that date and for the six days before that to display the full week's data. Code:

View Replies !
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

View Replies !
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.

View Replies !
Multiple Pages For One Mysql Query
how to get my mysql query to span over pages I would like it to be able to spread a large mysql query of over 100 over as many pages as needed. using maybe 50 results per page, or if that was adjustable it would make it even better..

View Replies !
Does PHP Have A Way To Export Records Of A MySQL Database?
Quite by accident, I found the mysqldump utility, that comes with MySQL,
which dumps/backsup a database, table, or record. It looks very versatile!

Does PHP have a way to export records of a MySQL database? Anything that
does the same independent of the database used?

View Replies !
How Many Records Will A MySql Database Hold?
how many records will a MySql database hold?

View Replies !
Set Session Variables From Records In A MySql Database
I am working on a memebship section for a website and I am trying to set session variables from records in a MySql database when the user logs in. I think I am missing something because try as I might the just don't work!

The sever I use had Glabal variables turned on, dont know if thats an issue in this case.

Heres the code on the check user page:

View Replies !
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 !
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 ?



View Replies !
Display MySQL Output Multiple Times
Hey, being a newbie at all this, I was wondering what's wrong with my code:

View Replies !
Call My Html/php Pages From A MySql Database
I wanted to call my html/php pages from a MySql database. But when I view the data in the table on my site it just shows the php statements as text. Is there a way to fix this?

View Replies !
PHP Script To Generate Static Pages From MySql Database.
I need to create static pages from a database and I cannot find such a script. 
The script must be able to create a static page from every record in the table and give it a URL and also create a static index page with links to the pages created from the table.

View Replies !
Avioding Expired Pages, & Carrying Data Accross Multiple Form Pages
I have a checkout/order form that consists of 6 pages, all PHP. The are linked to one another, like, after the user finishes page 1, they proceed to page 2, etc... The first two pages are submitted by a GET link, so those are not in my question. The next 4 are submitted using a <form>. Throughout all of the pages, i would probably have about 25-30 variables, things that the user has to fill out. I have two questions,

1. What would be the best way for me to keep track of all the data moving throughout the pages, like storing it from page 4, and i still need to access it on page 6.
2. I don't know if anyone could help me here, but does anyone know of a way to code around those ugly "page expired" pages, because of a submitted form. If a user needs to go back, which most likely they will, is there some sort of way for me to skip the expired page?

View Replies !
Display From Mysql Database
with this code the subject column is always the same when it should be different i.e. different entries in the database. Code:

View Replies !
Trying To Display Image From Mysql Database
I have a mysql db, that holds images.
Images are encoded using base64_decode/encode, etc. Image data seems
fine.
I have a view.php page that is supposed to show the image, and an
image.php page that accesses
the database, retrives the image data, and then (theoretically) prints
the decoded data to the page.
below is the view.php page code: problem area the img tag src no
worky.

What am i missing (having stolen the idea for this from the web!!!!
thanks,
eric
/************************************************** *****************/
<html>
<head>
<title>Get The Image</title>
<link rel="stylesheet" type="text/css" href="css/csssmall.css" />
</head>
<body>
<center><img src="testimage/Sunset.jpg" width="300" border="1"
alt="Image of Sunset"></center>
<p class="para-color"><?php echo 'Beautiful Image' ?></p>
<br>
<center><img src="image.php?img=3" width="200" border="1" alt="Image of
Thelma Todd"></center>
<p class="para-color"><?php echo ''Nother Beautiful Image' ?></p>
</body>
</html>
/************************************************** ****************/

below is the image.php code:
/************************************************** ********************
<?php
$dbhost = 'localhost'
$dbuser = 'auser'
$dbpass = 'apassword'
$dbcnx = @mysql_connect($dbhost,$dbuser,$dbpass);

if (!$dbcnx)
{
echo( "connection to database server failed!");
exit();
}
if (! @mysql_select_db("portfolio") )
{
echo( "Image Database Not Available!" );
exit();
}
?>
<?php
$img = $_REQUEST["img"];
?>

<?php
$result = @mysql_query("SELECT * FROM images WHERE id=" . $img . "");

if (!$result)
{
echo("Error performing query: " . mysql_error() . "");
exit();
}
while ( $row = @mysql_fetch_array($result) )
{
$imgid = $row["id"];
$encodeddata = $row["sixfourdata"];
$title = $row['title'];
}
?>
<?php
//echo $encodeddata;print??
echo base64_decode($encodeddata);
//echo $prefix . $encodeddata;
?>
/************************************************** ***********************

View Replies !
Mysql - Display Database Information
I'm sure php is not the only programming language that supports mysql and thus allowing us to display database information onto a webpage. so...

1) What are some of the other languages available?
2) What advantages does PHP have over them?

I'm asking because I have to justify why I wrote my webpage in PHP and not some other language. To be honest it was just suggested to me that I use PHP and so I did, didn't really look into whether its good or not.

View Replies !
Display The Currnet Mysql Database
i can display the current mysql database and user name with this query:

mysql> select databse(), user();

how i can print the output of this query  with a php script?

View Replies !
Text Display From My MySQL Database
There is also an id field that's an INI auto_increment. When I select the rows and try to display them, it appears as nothing. There are no error messages, but it just displays as nothing instead of the message in the MySQL database? What's wrong? PHP Code:

<?php
include "db_connect.php";
$id = $_GET['id'];
$sql = 'SELECT note FROM `notes` LIMIT 0, 30 WHERE id=$id'
$result = mysql_query($sql);
echo "Notes:<br><br>$result";
echo "ID #: $id";
?>

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 !
How To Connect To Mysql Database And Display It In Flash?
i made a code for news that get the data in php and store it in database, then display it using flash.. how to do this..

#news database fields:
newstitle
newsbody
newsdate


#variables:
$newstitle=$_POST['title'];
$newsbody=$_POST['body'];
$newsdate=date("Y-m-d");

View Replies !
How To Make Display Links From Mysql Database?
i have the following problem and i am breaking my mind on it:
I have a mysql database with (id,title,topic,body) in the database i have
stored some documents.
How can i display a link with only the title of the document stored?(easy
one) but...
I want to view the whole document in the same page!
Let me explain in code:

<?php
$ip = "localhost";
$user = "kostas";
$password = "kostas";
$basename = "test";
$table ="docs";
$db = mysql_connect($ip, $user, $password);
mysql_select_db($basename,$db);
$result1= mysql_query("SELECT * FROM $table ORDER BY id DESC LIMIT 5 ");
$myrow = mysql_fetch_array($result1);
$title = $myrow["title"];
$intro = $myrow["intro"];
$body = $myrow["body"];
?>

View Replies !
Display Items From A Mysql Database In A Table
I am trying to display items from a mysql database in a table but I need it to start a new table row each time multiples of 3 rows of the database table have been displayed like the following example:

item 1   item 2   item3
item 4   item 5   item 6

Does anybody know how I can make this work using php.

View Replies !
Script To Display The Current Mysql Database And User Name?
this is a php mysql script that should display the current database and user name:

?php
include 'library/config.php'
include 'library/opendb.php'
$query="select database(), user()";
$result=mysql_query($query);
echo $result;
include 'library/closedb.php'
?>

but the output of this script is:
Resource id #5
any one can help please?

View Replies !
Display The Messages (which Are Stored As Rows In A MySQL Database)
I am creating a message board for my website and I want to be able to display the messages (which are stored as rows in a MySQL database) so that it clearly shows if a message is a reply to someone elses message or an original message

example of 5 message (3 original posts and 2 replies)

post 1 - I like cake!
post 2 - Reply to post 1 =>I like cake too!
post 3 - Reply to post 2 which is a reply to post 1 =>What sort of cake??
post 4 - Hows the weather?
post 5 - Can't think of anything else

To distinguish a reply from an original post in my MySQL table i have a column called 'reply' which i fill with the ID number of the post it is reponding to. However this wont tell me if the reffering post is also a reply to another post. Does anyone know a good scalable way of doing this, and printing it on a screen with each reply indented and displayed under its reffering post?

View Replies !
Pull Data From MySQL Database And Display On Web Page.
I am trying to pull specific data from MySQL database using PHP and have it displayed on my web page. Go to my web page to see exactly what I want to do.

Right click on the link and open it in a new browser or else you will get stuck in the page. Please come back and post a reply with your knowledge. Code:

View Replies !
Multiple Database Crosstab MYSQL & PHP
I've got two databases and I'm trying to look with values from one table in
one database and then look up a name from the other database, the two tables
are linked where 'postedby' in my newsdb database refers to 'ID' in my
tblemployees table in my basedb database.
All I get is one name shown and 6 records where there are actually 7.

Code Below:
--------------------------------------------------------------
<?php
require_once('Connections/newsdb.php');
require_once('Connections/basedb.php');
mysql_select_db($database_newsdb, $newsdb);
$res_newsdb = mysql_query("SELECT * FROM tblnews ORDER BY newsdate DESC");
mysql_select_db($database_basedb, $basedb);
$row_newsdb=mysql_fetch_object($res_newsdb);
$res_basedb=mysql_query("SELECT * from tblemployees WHERE
ID=$row_newsdb->postedby");
?>

<html>
<link href="body01.css" rel="stylesheet" type="text/css">

<body>
<table width="500" border="0" class="body01" style='BORDER-COLLAPSE:
collapse'>
<tr>
<td>Latest News:</td>
<td><div align="right"><a href="../phpbb" target="_MainFrame">Bulletin
Board</a></div></td>
</tr>
</table>
<p class="body01">
<?php
echo ("<TABLE BORDER=&#391;' WIDTH=450 style='BORDER-COLLAPSE: collapse'>");
$rows=1;
while($rows <= 10)
{
$res_news = mysql_fetch_array($res_newsdb);
$res_base = mysql_fetch_array($res_basedb);
$ndate = $res_news['newsdate'];
echo ('<TR><TD><FONT SIZE=-2><div align="center">' . $ndate .
'</div></FONT></TD><TD>' .
$res_news['news']) . '</TD><TD>' .
$res_base['IDname'] . '</TD></TR>'
$rows++;
}
mysql_free_result($res_newsdb);
echo('</TABLE>');

echo("<BR /><P><A HREF='addnews.php'>Add news</A></P>");

?>
</p>
<p><span class="body01">To email the website manager click </p>
</body>
</html>
---------------------------------------------------------------------

View Replies !
Can You Pull Multiple Pages Somehow Using Multiple Curl_exec's Before Calling Curl_close?
so after mulling over some way to use keep-alives with fsockopen I figured it would be easier to just switch to CURL which happens to support a ton of stuff including persistent connections.

I did some reading and all I could find was to take advantage of persistent connections one only has to specify multiple URLS with setopt before calling exec:

curl_setopt($ch, CURLOPT_URL, "http://www.example/");
curl_setopt($ch, CURLOPT_URL, "http://www.example.com/anotherpage.html");

and so on...

I put together a test script to see how the output would look but all I found was the last URL being displayed where I expected to see all specified pages spit out one after another in one page.

Am I doing this wrong, or maybe my home wamp setup isn't configured properly?

Perhaps the persistent connection thing is for the same curl session.. can you pull multiple pages somehow using multiple curl_exec's before calling curl_close? or are you supposed to call curl_close once the page is downloaded and before doing functions on the output?

View Replies !
Next/previous Records (not Pages)
I have a perl script (DBMan) running which can be viewed at http://embassylinks.com (select Cyprus as Guest for testing) The perl script uses a flat file, but I am switching to MySQL, so I am writing my own PHP viewing script.

I want to have the same navigation on the php script as the perl script. I already have the "pages" navigation (i.e. Prev 1 2 3 Next) for the table of records nearly worked out, but I still need to do the "record" navigation (i.e. Record 1 of 120) for the individual records when clicking on the hyperlink in the table to display the individual record.

The best way to understand what I mean is to look at the 2 scripts above and see the actual examples. Can anyone point to a sample script or offer some ideas for the "record navigation". I am looking for something like the "first prev next last" record links that most databases display.

View Replies !
How To Upload Multiple Images To A Mysql Database?
ive been looking for a tutorial or a snippet of code that would allow me to go to a browse button, navigate to a directory, and either upload everything in that directory or let me select what ones to upload, all i have been able to find are multiple inputs and each image needs to be uploaded individually.. Anyone seen anything like this before?

View Replies !
Selecting From Multiple Tables In Mysql Database
I want to make an RSS feed displaying the latest updates on my website. My site has 3 sections: reviews, interviews and news. I want to combine them into 1 RSS feed.

So that means I have to find the 10 newest items throughout all 3 database tables. The problem is that the tables have some fields in common (like 'activated_dt', a datetime field) but not all.

What would be a good query to find the 10 newest items??

SELECT ID
FROM reviews,interviews,news
ORDER BY activated_dt DESC
LIMIT 10

But how do I know what table the ID is from?

View Replies !
"Information Is Recieved" It Says, However, NO RECORDS In Database (mysql)
I finally got it to the point where there are NO errors and it says, "Information has been received." However there are NO RECORDS IN DATABASE! Code:

View Replies !
Easiest Way To Backup Your MySQL Database On Multiple FTP Servers For FREE!
Here's the only tool you need to do scheduled backups of your MySQL database
on multiple FTP servers! It PHP based so there's no lengthy installation
process involved. Extract the file on any directory of your choice, edit the
configuration file and you're good to go! And best of all.... IT"S FREE!!!

Visit: http://sourceforge.net/projects/myphpdumptool/

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 !
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 !
No Records To Display
I am setting up your basic record retreival using a mySQL database and PHP. If there are no records that match the query, I would like to display a simple message indicating so.
Here is the code I was working with so far: Code:

View Replies !
Display Records
I have a dynamically populated jump menu that displays all of the names in my database. Originally I tried setting anchored links for each artist, but I can't it to work across dynamic pages. How do I configure it post the the rest of the data for the item selected to a second page or to the table on the original page. Sorry if I'm off on the terminology. I'm getting close here. This is the only missing piece.

View Replies !
Display All Records
I have the following code, that displays records in my database. How do I display each record along with a checkbox, then when a delete button is clicked, delete the selected records.

mysql_select_db("my_db", $con);

$result = mysql_query("SELECT * FROM person");

while($row = mysql_fetch_array($result))
{
  echo $row['FirstName'] . " " . $row['LastName'];
  echo "<br />";
}

View Replies !
Display Certain Records
I have a database with records that change every so often. Some products need to be taken out of the database so they will not be displayed and then later, they need to be put back in. I am looking for a way to not have to delete the product everytime and have to be reentered, maybe have a checkbox that is linked to the product and check and uncheck the box for the item to be displayed or not.

View Replies !

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