PHP Installation
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Installation

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old August 22nd, 2005, 04:47 AM
aryashahin aryashahin is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 1 aryashahin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
PHP - Previous and Next Links

hi guys...
ok... before i start just letting you know I am new to whole php/sql thing..
now i am developing my web site
>. http://www.maxdesings.5gigs.com
I am gona have lots of tuts ...
therefore i need to have page browser ( prev 6 7 8 9 10 next )
================
now i been following the tuts on this site...
http://codewalkers.com/tutorials/4/1.html

PHP - Previous and Next Links by Matt Wade
but I do get this message when i view my page
========================
Warning: mysql_query(): Access denied for user: 'maxdesig@localhost' (Using password: NO) in /home/maxdesig/public_html/tutorials/photography/index.php on line 16

Warning: mysql_query(): A link to the server could not be established in /home/maxdesig/public_html/tutorials/photography/index.php on line 16

Warning: mysql_query(): Access denied for user: 'maxdesig@localhost' (Using password: NO) in /home/maxdesig/public_html/tutorials/photography/index.php on line 22

Warning: mysql_query(): A link to the server could not be established in /home/maxdesig/public_html/tutorials/photography/index.php on line 22

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/maxdesig/public_html/tutorials/photography/index.php on line 23

=======================here is the code===============

php Code:
Original - php Code
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4. <title>Untitled Document</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  6. <link href="tut.css" rel="stylesheet" type="text/css">
  7. </head>
  8.  
  9. <body>
  10.  
  11. <?php
  12. if(!isset($start)) $start = 0;
  13.  
  14. $query = "SELECT * FROM table LIMIT " . $start . ", 10";
  15. //do database connection
  16. $result = mysql_query($query); //you should do error checking
  17. //display data
  18.  
  19. //this code was wrong, I did not have the second query. Thanks to Plaggy Pig.
  20. // need another query to get the total amount of rows in our table
  21. $query = "SELECT count(*) as count FROM table";
  22. $result = mysql_query($query);
  23. $row = mysql_fetch_array($result);
  24. $numrows = $row['count'];
  25. if($start > 0)
  26.    echo "<a href="" . $PHP_SELF . "?start=" . ($start - 10) .
  27.         "">Previous</a><BR>n";
  28. if($numrows > ($start + 10))
  29.    echo "<a href="" . $PHP_SELF . "?start=" . ($start + 10) .
  30.         "">Next</a><BR>n";
  31. ?>
  32.  
  33.  
  34. </body>
  35. </html>
  36.  

=====================


What am i doing wrong.??
if its database... could you please guide me through it???!!!
tanx

Reply With Quote
  #2  
Old August 22nd, 2005, 07:25 AM
Milo Milo is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Italy
Posts: 192 Milo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: PHP - Previous and Next Links

The problem shoud be here :
Warning: mysql_query(): Access denied for user: 'maxdesig@localhost' (Using password: NO) in /home/maxdesig/public_html/tutorials/photography/index.php on line 16

If your user that connects to db has a login and a password when it says USING PASSWORD NO means that the function has no password to supply on connection to the db. Check the syntax and the spell of the variables u use in the connection.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Installation > PHP - Previous and Next Links


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway