Re: [PHP-DB] Need Help Compiling PHP5 With MS SQL Support
On Mon, Jul 03, 2006 at 11:14:48AM -0400, Mike wrote: I am new to Linux and have NEVER compiled PHP. I have PHP 5 and need to compile it with MS SQL support. Per PHP docs, I installed FreeTDS and tested it and it works. Now I need to (re)compile PHP to get the support I need to access MS SQL databases. I am on a Ubuntu 6.06 version of Linux. Since you're on Ubuntu, I reckon this kind of explains what you want to do (at least if you want to keep using Ubuntu packages): http://panthar.org/2006/06/15/php-with-mssql-on-ubuntu-606/ (first hit on Google, btw) -- Riemer PalstraAmsterdam, The Netherlands [EMAIL PROTECTED]http://www.palstra.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] LIMIT
I see they call mysql_query twice which doesn't look like I'm gaining anything over running the 2 queries: SELECT count(*) as MyCount FROM aTable SELECT * FROM aTable LIMIT 5 But I suppose I need to time it for my app. http://us3.php.net/mysql_num_rows mancini at nextcode dot org 14-Nov-2005 02:24 here is a really fast mysql_num_rows alternative that makes use of the SELECT FOUND_ROWS() MySQL function , it only reads a single row and it is really helpfull if you are counting multiple tables with thousands of rows ?php function get_rows ($table) { $temp = mysql_query(SELECT SQL_CALC_FOUND_ROWS * FROM $table LIMIT 1); $result = mysql_query(SELECT FOUND_ROWS()); $total = mysql_fetch_row($result); return $total[0]; } ? +++ alex dot feinberg 4t gm41l 28-Apr-2005 04:56 Re dzver at abv dot bg's note... I just ran some tests using MySQL Super Smack. Surprisingly, a SELECT * followed by a SELECT COUNT(*) actually was close in speed to a SELECT SQL_CALC_FOUND_ROWS * followed by a SELECT FOUND_ROWS(), but the SQL_CALC_FOUND_ROWS solution was still a bit faster. Perhaps it varies by table structure? Either way, it might be worth checking which is faster for your application. Regards, Dwight -Original Message- From: Dwight Altman [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 05, 2006 9:53 AM To: 'php-db@lists.php.net' Subject: RE: [PHP-DB] LIMIT So how do I get this information on the PHP side? mysql SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name - WHERE id 100 LIMIT 10; mysql SELECT FOUND_ROWS(); I count 2 queries above (unless there is some caching magic). Whatever. I was hoping to add another column (like FOUND_ROWS) to an existing query and be able to pull out the FOUND_ROWS when I loop over the result set. Something like: SELECT *, FOUND_ROWS FROM aTable LIMIT 5 But since that single query doesn't work, how do I apply the MySQL solution and extract it on the PHP side? http://dev.mysql.com/doc/refman/4.1/en/information-functions.html http://www.mysqlfreaks.com/statements/101.php Regards, Dwight -Original Message- From: Chris [mailto:[EMAIL PROTECTED] Sent: Friday, June 30, 2006 9:46 AM To: php-db@lists.php.net Subject: Re: [PHP-DB] LIMIT If you're using MySQL then: SELECT SQL_CALC_FOUND_ROWS * FROM aTable LIMIT 5 SELECT FOUND_ROWS() It's in the mysql documentation under SELECT syntax I believe. Chris Dwight Altman wrote: Is there a way to get the number of rows that would have been returned had there not been a LIMIT clause in a SELECT statement? For example, if Query #1) SELECT * FROM aTable would normally return 100 rows. But Query #2) SELECT * FROM aTable LIMIT 5 will return 5 rows. Is there a way to find out that 100 rows would have been returned if there was no LIMIT clause, by using only Query #2 and maybe a PHP function on the $result? Regards, Dwight -- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] LIMIT
So how do I get this information on the PHP side? mysql SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name - WHERE id 100 LIMIT 10; mysql SELECT FOUND_ROWS(); I count 2 queries above (unless there is some caching magic). Whatever. I was hoping to add another column (like FOUND_ROWS) to an existing query and be able to pull out the FOUND_ROWS when I loop over the result set. Something like: SELECT *, FOUND_ROWS FROM aTable LIMIT 5 But since that single query doesn't work, how do I apply the MySQL solution and extract it on the PHP side? http://dev.mysql.com/doc/refman/4.1/en/information-functions.html http://www.mysqlfreaks.com/statements/101.php Regards, Dwight -Original Message- From: Chris [mailto:[EMAIL PROTECTED] Sent: Friday, June 30, 2006 9:46 AM To: php-db@lists.php.net Subject: Re: [PHP-DB] LIMIT If you're using MySQL then: SELECT SQL_CALC_FOUND_ROWS * FROM aTable LIMIT 5 SELECT FOUND_ROWS() It's in the mysql documentation under SELECT syntax I believe. Chris Dwight Altman wrote: Is there a way to get the number of rows that would have been returned had there not been a LIMIT clause in a SELECT statement? For example, if Query #1) SELECT * FROM aTable would normally return 100 rows. But Query #2) SELECT * FROM aTable LIMIT 5 will return 5 rows. Is there a way to find out that 100 rows would have been returned if there was no LIMIT clause, by using only Query #2 and maybe a PHP function on the $result? Regards, Dwight -- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] LIMIT
Here are some thoughts on the couple of methods shown: 1. SELECT count(*) as MyCount FROM aTable # Fast query done on server size SELECT * FROM aTable LIMIT 5 # Fast limited data return query done server side 2. SELECT * FROM aTable # Potentially slow query, lots of data stored in PHP mysql_num_rows() # Quick PHP-side function to tell how many results returned 3. SELECT SQL_CALC_FOUND_ROWS * FROM $table LIMIT 5 # Fast server side query that does the same as SELECT count(*) and SELECT LIMIT 5 at the same time SELECT FOUND_ROWS() # Fast server side query Seems like #1 and #3 are your best options. Both are pretty easy on your system. #3 is definitely pretty slick, thanks to whoever originally posted that. But I'm wondering if it'll be fully compatible in the future. #1 is pretty SQL 101 type stuff, so it should remain functional and be usable on other database platforms as well. That's the one I'd go for, just for the sake of keeping things simple if nothing else. Seems like a waste to do two database queries, but as long as you're not closing and re-opening the connection in between, it should cause very minimal impact on your system. Sometimes two queries are better than one. -TG = = = Original message = = = I see they call mysql_query twice which doesn't look like I'm gaining anything over running the 2 queries: SELECT count(*) as MyCount FROM aTable SELECT * FROM aTable LIMIT 5 But I suppose I need to time it for my app. http://us3.php.net/mysql_num_rows mancini at nextcode dot org 14-Nov-2005 02:24 here is a really fast mysql_num_rows alternative that makes use of the SELECT FOUND_ROWS() MySQL function , it only reads a single row and it is really helpfull if you are counting multiple tables with thousands of rows ?php function get_rows ($table) $temp = mysql_query(SELECT SQL_CALC_FOUND_ROWS * FROM $table LIMIT 1); $result = mysql_query(SELECT FOUND_ROWS()); $total = mysql_fetch_row($result); return $total[0]; ? +++ alex dot feinberg 4t gm41l 28-Apr-2005 04:56 Re dzver at abv dot bg's note... I just ran some tests using MySQL Super Smack. Surprisingly, a SELECT * followed by a SELECT COUNT(*) actually was close in speed to a SELECT SQL_CALC_FOUND_ROWS * followed by a SELECT FOUND_ROWS(), but the SQL_CALC_FOUND_ROWS solution was still a bit faster. Perhaps it varies by table structure? Either way, it might be worth checking which is faster for your application. Regards, Dwight -Original Message- From: Dwight Altman [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 05, 2006 9:53 AM To: 'php-db@lists.php.net' Subject: RE: [PHP-DB] LIMIT So how do I get this information on the PHP side? mysql SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name - WHERE id 100 LIMIT 10; mysql SELECT FOUND_ROWS(); I count 2 queries above (unless there is some caching magic). Whatever. I was hoping to add another column (like FOUND_ROWS) to an existing query and be able to pull out the FOUND_ROWS when I loop over the result set. Something like: SELECT *, FOUND_ROWS FROM aTable LIMIT 5 But since that single query doesn't work, how do I apply the MySQL solution and extract it on the PHP side? http://dev.mysql.com/doc/refman/4.1/en/information-functions.html http://www.mysqlfreaks.com/statements/101.php Regards, Dwight -Original Message- From: Chris [mailto:[EMAIL PROTECTED] Sent: Friday, June 30, 2006 9:46 AM To: php-db@lists.php.net Subject: Re: [PHP-DB] LIMIT If you're using MySQL then: SELECT SQL_CALC_FOUND_ROWS * FROM aTable LIMIT 5 SELECT FOUND_ROWS() It's in the mysql documentation under SELECT syntax I believe. Chris Dwight Altman wrote: Is there a way to get the number of rows that would have been returned had there not been a LIMIT clause in a SELECT statement? For example, if Query #1) SELECT * FROM aTable would normally return 100 rows. But Query #2) SELECT * FROM aTable LIMIT 5 will return 5 rows. Is there a way to find out that 100 rows would have been returned if there was no LIMIT clause, by using only Query #2 and maybe a PHP function on the $result? Regards, Dwight -- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] need help on setting up tables for db (NFL Football)
Team, I was wondering if anybody can help me or guide me On what tables to make. I want to do all the data entry I just do not know what to do. It's for a fantasy football League. Here is my project! Let me know if anyone can help me directly, through Email, AIM, or MSN. http://www.theufl.com/ufl_project.htm Your help would be greatly appreciated. I would be using phpmyadim for this. Karl James (TheSaint) mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] www.theufl.com
Re: [PHP-DB] need help on setting up tables for db (NFL Football)
Karl James wrote: Team, Heh! I was wondering if anybody can help me or guide me On what tables to make. I want to do all the data entry I just do not know what to do. It's for a fantasy football League. Here is my project! Let me know if anyone can help me directly, through Email, AIM, or MSN. http://www.theufl.com/ufl_project.htm Your help would be greatly appreciated. I would be using phpmyadim for this. Sure. How much do you pay? -Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Do while loop inside of mail()
MySQL 4.1/PHP 4.2 I am trying to generate a email to send to people with a list of events happening through out the month. I am pulling the email addresses from the database with no problem, but when I put the list of events inside of the mail(), it barks at the do while statment. Here is the do while code: $message='table width=100% border=0 tr class=style2 td width=20% class=style8uProject Number /u/td td width=20%ustrongStart Date/strong/u/td td width=26%ustrongClass/strong/u/td td width=34%ustrongLocation/strong/u/td /tr/table Line 28 'do { .' tr class=style2 td width=20% class=style8'.$row_Recordset1['pnumber'].'/td td width=20%'.date(m/d/Y, strtotime($row_Recordset1['Sdate'])).'/td td width=26%'.$row_Recordset1['title'].'/td td width=34%'.$row_Recordset1['location'].'/td /tr'. while } $row_Recordset1 = mysql_fetch_assoc($Recordset1)).'/table'; And the server response *Parse error*: parse error in */home/Data/email/test.php* on line *28* Line 28 is the start of the do while loop markb -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Do while loop inside of mail()
I don't see you closing the single quote at the end of the statement before do loop Bastien From: Mark Bomgardner [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: Php-Db php-db@lists.php.net Subject: [PHP-DB] Do while loop inside of mail() Date: Wed, 05 Jul 2006 16:55:23 -0500 MySQL 4.1/PHP 4.2 I am trying to generate a email to send to people with a list of events happening through out the month. I am pulling the email addresses from the database with no problem, but when I put the list of events inside of the mail(), it barks at the do while statment. Here is the do while code: $message='table width=100% border=0 tr class=style2 td width=20% class=style8uProject Number /u/td td width=20%ustrongStart Date/strong/u/td td width=26%ustrongClass/strong/u/td td width=34%ustrongLocation/strong/u/td /tr/table Line 28 'do { .' tr class=style2 td width=20% class=style8'.$row_Recordset1['pnumber'].'/tdtd width=20%'.date(m/d/Y, strtotime($row_Recordset1['Sdate'])).'/td td width=26%'.$row_Recordset1['title'].'/td td width=34%'.$row_Recordset1['location'].'/td /tr'. while } $row_Recordset1 = mysql_fetch_assoc($Recordset1)).'/table'; And the server response *Parse error*: parse error in */home/Data/email/test.php* on line *28* Line 28 is the start of the do while loop markb -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] problem with list
Team, When I receive an email from this list and only this list, I receive 6 copies. Can any one suggest any ideas why this is happening. I didn't sign up 6 times. Thanks, for your advise. Its becoming annoying, obviously! Karl Karl James (TheSaint) mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] www.theufl.com
Re: [PHP-DB] Do while loop inside of mail()
Mark Bomgardner wrote: MySQL 4.1/PHP 4.2 I am trying to generate a email to send to people with a list of events happening through out the month. I am pulling the email addresses from the database with no problem, but when I put the list of events inside of the mail(), it barks at the do while statment. Here is the do while code: $message='table width=100% border=0 tr class=style2 td width=20% class=style8uProject Number /u/td td width=20%ustrongStart Date/strong/u/td td width=26%ustrongClass/strong/u/td td width=34%ustrongLocation/strong/u/td /tr/table Line 28 'do { .' tr class=style2 td width=20% class=style8'.$row_Recordset1['pnumber'].'/td td width=20%'.date(m/d/Y, strtotime($row_Recordset1['Sdate'])).'/td td width=26%'.$row_Recordset1['title'].'/td td width=34%'.$row_Recordset1['location'].'/td /tr'. while } $row_Recordset1 = mysql_fetch_assoc($Recordset1)).'/table'; Before anything else, a helpful hint. Make your code cleaner, it will be easier to work out whats going on: $message= ' table width=100% border=0 tr class=style2 td width=20% class=style8uProject Number/u/td td width=20%ustrongStart Date/strong/u/td td width=26%ustrongClass/strong/u/td td width=34%ustrongLocation/strong/u/td /tr /table'; do { $message .= 'tr class=style2 td width=20% class=style8'.$row_Recordset1['pnumber'].'/td td width=20%'.date(m/d/Y, strtotime($row_Recordset1['Sdate'])).'/td td width=26%'.$row_Recordset1['title'].'/td td width=34%'.$row_Recordset1['location'].'/td /tr'; } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); $message .= '/table'; which one is easier to read and debug? -- Postgresql php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php