GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 07-Nov-2005, 22:45
fallen_samurai fallen_samurai is offline
Awaiting Email Confirmation
 
Join Date: Oct 2005
Location: Wisconsin, USA
Posts: 29
fallen_samurai is on a distinguished road

Need a MySQL alternative to SQL_CALC_FOUND_ROWS


Hey, I'm still working on the same forum system as my previous post. I am stuck at the point where I'm supposed to use SQL_CALC_FOUND_ROWS and FOUND_ROWS() functions in a SQL statement. This section of the forum script is made to make a multi-page format for each thread (which will later be used for multi-paging the posts as well).

My problem: My version of SQL is too old, SQL_CALC_FOUND_ROWS does not exist (or that it does, but won't work with a limit statment [as read from mysql.com]). Version = 3.23.

Is there an alternate SQL statement, that works with 3.23, that I can use to finish this multi-page script?

[EDIT:] NOTE: One thing I do not want to do is use premade code or scripts, this is a personal project to test my own skills, which went well until I got stuck with old version MySQL.
  #2  
Old 12-Nov-2005, 17:22
Error's Avatar
Error Error is offline
Junior Member
 
Join Date: May 2005
Posts: 42
Error is on a distinguished road

Re: Need a MySQL alternative to SQL_CALC_FOUND_ROWS


Why can't you upgrade to a newer version of MySql?
  #3  
Old 12-Nov-2005, 23:24
fallen_samurai fallen_samurai is offline
Awaiting Email Confirmation
 
Join Date: Oct 2005
Location: Wisconsin, USA
Posts: 29
fallen_samurai is on a distinguished road

Re: Need a MySQL alternative to SQL_CALC_FOUND_ROWS


As much as I appreciate your response, I was hoping someone wouldn't ask that. I'm running a very important webserver in my home with a web-store on it. I don't want to run the risk of ANY problems resulting from updating the system, so right now updating is impossible. I need a replacement for SQL_CALC_FOUND_ROWS....even a work around is fine.
  #4  
Old 14-Nov-2005, 19:02
Error's Avatar
Error Error is offline
Junior Member
 
Join Date: May 2005
Posts: 42
Error is on a distinguished road

Re: Need a MySQL alternative to SQL_CALC_FOUND_ROWS


What does the SQL_CALC_FOUND_ROWS statement do? I am sorry, but I'm new to MySql and was unable to find it in the help.
  #5  
Old 15-Nov-2005, 01:13
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough

Re: Need a MySQL alternative to SQL_CALC_FOUND_ROWS


fallen,

I don't understand -- you already know the "work-around". You mentioned it here, specifically inside this post. The count(*) bit...
  #6  
Old 15-Nov-2005, 13:24
fallen_samurai fallen_samurai is offline
Awaiting Email Confirmation
 
Join Date: Oct 2005
Location: Wisconsin, USA
Posts: 29
fallen_samurai is on a distinguished road

Re: Need a MySQL alternative to SQL_CALC_FOUND_ROWS


True, but I guess in that post I was asking if you thought that would work, but no harm in trying I guess. Thanks for the help
  #7  
Old 16-Nov-2005, 10:34
Error's Avatar
Error Error is offline
Junior Member
 
Join Date: May 2005
Posts: 42
Error is on a distinguished road

Re: Need a MySQL alternative to SQL_CALC_FOUND_ROWS


You could use the php
PHP Code:

$result = mysql_query("SELECT * FROM table WHERE param = field");
$row = mysql_fetch_array($result);

foreach ($i as $row)
    $count++; 


or get the number of rows or mysql_num_rows()
 
 

Recent GIDBlogA Week in Kuwait by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FREE Hosting,400MB-10GIGS BW,phpBB,SMF,myBB,phpBB RPG,php,25 MySql db's,Z-panel..more cknetworx Free Web Hosting 6 27-Nov-2007 07:07
CPanel 10, Unlimited Emails, Unlimited Subdomains, Unlimited MySQL. $2.00 per Month Kalypsoweb Web Hosting Advertisements & Offers 0 30-Oct-2005 01:51
php and mysql vladimy MySQL / PHP Forum 2 28-May-2005 05:17
Windows: From only £20p/y,Linux: from $10p/m. ASP, ASP.NET, PHP, Free MySQL, +More EyotaHosts Web Hosting Advertisements & Offers 0 28-Jun-2003 13:54

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 17:00.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.