[PHP-DB] Performance in MySQL Result Question

2003-03-15 Thread Jan Bro
Hi,
I've got a page with lot's of visitors every day and I sure hope to 
get more, so I'm already thinking of performance. This is what I've
got. 

Users select one or more things out of a couple drop down menus,
no big deal. Their selection is than shown, with a limitation of
20 results on the page. 

Now comes my question, what is better speaking of performance: 
When users go on to the next page, is it better to 
provide the select statement again with a different integer for
the limit? 

Or is better to do a full select without a limitation on first page.
But than I don't know how to provide the result set for the 
next, next, ... page?

What would be your choice? I'm open to suggestions, maybe somebody has
a totally different idea. The limitation of 20 is a wish of my customer.
I think, most vistors won't stay on page one, but will click thru
some pages further. The max. number of results shown should be around
1000 hits.

Jan


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Listing Tables

2003-03-15 Thread shaun
Hi,

i would like to list all of the tables and field names in my database

e.g.

table 1
  field 1
  field 2
  field 3
table 2
  field 1
  field 2
  field 3
table 3
  field 1
  field 2
  field 3
etc

is there a simple way to do this?

thanks for your help



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: Listing Tables

2003-03-15 Thread Joel Colombo
http://us2.php.net/manual/en/function.mysql-list-tables.php
http://us2.php.net/manual/en/function.mysql-list-fields.php

you should really check the manuals before posting... they are built right
in...

Joel



Shaun [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 i would like to list all of the tables and field names in my database

 e.g.

 table 1
   field 1
   field 2
   field 3
 table 2
   field 1
   field 2
   field 3
 table 3
   field 1
   field 2
   field 3
 etc

 is there a simple way to do this?

 thanks for your help





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] PHP / Sendmail question

2003-03-15 Thread Chris Payne
Hi there everyone,

When using PHP to send using sendmail, what is the option name so that failed mails 
bounce back to the email account of the domain SENDING it?  Currently failed mails 
return to [EMAIL PROTECTED] and that screws the server up - bearing in mind I have 
multiple domains and just 1 needs this, which is why i'd rather have it set in the PHp 
script than in the php.ini or some other way.

Sorry if i've confused you LOL.

Chris

RE: [PHP-DB] Performance in MySQL Result Question

2003-03-15 Thread John W. Holmes
[snip]
 Now comes my question, what is better speaking of performance:
 When users go on to the next page, is it better to
 provide the select statement again with a different integer for
 the limit?
 
 Or is better to do a full select without a limitation on first page.
 But than I don't know how to provide the result set for the
 next, next, ... page?
[snip]

Use a limit, it's efficient. You can't do a full select on one page and
somehow carry the result over to another page with any kind of
efficiency.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Insert Date

2003-03-15 Thread John W. Holmes
 I'm having problem inserting the date into my mysql database.  What
type
 of field should my date field be?
 How do I insert that into a database, the current date for example?
 INSERT INTO tblDate (fldDate) VALUES ( . Date() . );

You should use a DATE column, maybe?? Or a timestamp, depending on what
you want to do.

The query you'd use is:

INSERT INTO tblDate (fldDate) VALUES (NOW())

where NOW() is a MySQL function, not a PHP one. MySQL date formats are
MMDD (as an integer) or -MM-DD (as a string). 

Adapt to your needs.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Inserting data into MySQL

2003-03-15 Thread Louie Henry
Good Day All!
I have been working a php/mysql and I have ran into a small problem. I
have written an html form for inserting data, and it will not insert
it. I am able to query the data from the data. I here is some of the code,
maybe some one could point out the error.
__ 

$query = INSERT into TBLutnsUser values
( .$fname., .$lname., .$email., .$phonenum., .$celnum.,
.$address., .$city., .$prov., .$postalcode.);
__
There is one other field that is not in here, that is userIndex. and it is
the indexing/primary key, and it is auto_increment. dose it need to be
added in here too?
Thank You
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Inserting data into MySQL

2003-03-15 Thread John Gray
yes, or you need to use the 'INSERT INTO ([field1, field2...]) values
(['val1', 'val2'...]) syntax. check the mysql insert syntax.
http://www.mysql.com/doc/en/INSERT.html

- john

On Sat, Mar 15, 2003 at 06:37:54PM -0500, Louie Henry [EMAIL PROTECTED] wrote:
 Good Day All!
 I have been working a php/mysql and I have ran into a small problem. I
 have written an html form for inserting data, and it will not insert
 it. I am able to query the data from the data. I here is some of the code,
 maybe some one could point out the error.
 __
  
 
 $query = INSERT into TBLutnsUser values
 ( .$fname., .$lname., .$email., .$phonenum., .$celnum.,
 .$address., .$city., .$prov., .$postalcode.);
 __
 There is one other field that is not in here, that is userIndex. and it is
 the indexing/primary key, and it is auto_increment. dose it need to be
 added in here too?
 Thank You
 
 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Real Killer App!

2003-03-15 Thread Nicholas Fitzgerald
Well, I've gotten a long way on this, and here's the results up to now:

On Red Hat 8.0 appache 2.0.40, php 4.22, mysql 3.23.54a
PII 366 30gig hdd, 256meg mem:
Everything works flawlessly. Have spidered several HUGE sites. Goes 
fast, goes accurate.

On windows 2000 sp3, apache 2.0.44, php 4.3.1, mysql 3.23.55 max-nt
dual PIII 1gig, 160gig raid, 1.5gig mem:
Spider still dies, but now it's finally given me an error: FATAL: 
erealloc(): unable to allocate 11 bytes. This is interesting, as I'm 
not using erealloc() anywhere in the script. When I went to php.net to 
check it out, all I got was a memory management page with this and 
some other memory type functions listed. No information at all about 
what to do with them, how to use them, where to use them, when to use 
them, or anything. If anyone out there has any info on this function 
and/or the error it gave me please pass it along!

Nick



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] use a leech filedownloader

2003-03-15 Thread Lars Rasmussen
Hi all,

I'm about to make a backup php program that takes a backup with tar,
read's the output, send it with som headers so it's supposed to dowload,
and then it deletes the file, but it just doesent work with files that
is about 50MB, i hope one of you specialist's can help me 

JUST SO YOU KNOW, IT WORKS FINE WITH FILES ON ABOUT 4MB)

I tried ANY combination with the functions / headers that i commented
out...
---mainfile---
?php
require_once(functions.php);
//set_time_limit(0);
//ignore_user_abort(true);
session_cache_limiter();
ob_start();
$filename .= backup--;
$filename .= date(d-m-Y);
$filename .= --{$_SESSION[username]}.tar.gz;
exec(tar cvzfp /backup/{$filename} {$_SESSION[myhomedir]});
print(read_file(backup/{$filename}));
//header(Cache-control: private);
//header(Content-Type: application/txt);
//header(Content-Disposition: attachment; filename={$filename});
//Header(Content-type: text/plain);
//Header(Content-Disposition: attachment;
filename=topsellers_dvd.csv);
//header(Content-Disposition: inline;filename=test.tar.gz);

header(Content-type: application/octet-stream);
header(Content-Length: .filesize(backup/{$filename}));
if (strstr($_SERVER[HTTP_USER_AGENT], MSIE)) {
header(Content-Disposition: attachment; filename={$filename} .
%20);
} else {
header(Content-Disposition: attachment; filename={$filename});
}

exec(rm /backup/{$filename});
ob_end_flush();
?
-

--functions.php--
?php

function read_file($file) {

if (!($fp = fopen($file, 'r' ))) return false;
$contents = fread($fp, filesize($file));
fclose($fp);
return $contents;
}

?
-

Regards
Lars Rasmussen.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Real Killer App!

2003-03-15 Thread VolVE
I would compare the php.ini settings on the 2 systems.

phpinfo() will be able to give you the current stat of the variables PHP is
using. There could be something strange on the Windows system that you'll
notice as different on the Linux box's phpinfo() (hopefully).

-VolVE

- Original Message -
From: Nicholas Fitzgerald [EMAIL PROTECTED]
To: PHP Database List [EMAIL PROTECTED]
Sent: Saturday, March 15, 2003 19:55
Subject: Re: [PHP-DB] Real Killer App!


 Well, I've gotten a long way on this, and here's the results up to now:

 On Red Hat 8.0 appache 2.0.40, php 4.22, mysql 3.23.54a
 PII 366 30gig hdd, 256meg mem:
 Everything works flawlessly. Have spidered several HUGE sites. Goes
 fast, goes accurate.

 On windows 2000 sp3, apache 2.0.44, php 4.3.1, mysql 3.23.55 max-nt
 dual PIII 1gig, 160gig raid, 1.5gig mem:
 Spider still dies, but now it's finally given me an error: FATAL:
 erealloc(): unable to allocate 11 bytes. This is interesting, as I'm
 not using erealloc() anywhere in the script. When I went to php.net to
 check it out, all I got was a memory management page with this and
 some other memory type functions listed. No information at all about
 what to do with them, how to use them, where to use them, when to use
 them, or anything. If anyone out there has any info on this function
 and/or the error it gave me please pass it along!

 Nick



 --
 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] group by get last record

2003-03-15 Thread Daniel Harik
Hello,

Guys i try to join to tables

slides:
id
userid
file
moment

users
id
username

As there few slids per user and i want to get only last one, i use following 
sql query, but it fetches me first slide. How can i make it fetch last one 
please?

 SELECT slides.file, slides.moment, users.id, users.username FROM slides, 
users where users.id=slides.userid GROUP BY users.id desc 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php