What about in MySQL:
SELECT personID from persons ORDER BY RAND(NOW()) LIMIT 1
If the table is large, then the following might be better:
LOCK TABLES foo READ;
SELECT FLOOR(RAND() * COUNT(*)) AS rand_row FROM foo;
SELECT * FROM foo LIMIT $rand_row, 1;
UNLOCK TABLES;
There's a whole discussion on it
I'm running PHP as CGI instead of as an apache module because my hosting
1) suggests it and 2) this way I can compile my own PHP with whatever
options I want, including a custom php.ini.
Works great except when I load a page that doesn't exist, such as
foo.php, I get "No input file specified."
> Hi guys,
> Recently, I had to reformat one of the web servers and now I have
> encountered an unusual problem. I am not sure whether this is an
> issue which
> can be fixed in the .ini file or whether its specific to the
> version of php
> I am using.
>
> Here is the problem:
>$query="SELECT
Jared wrote:
foo.php, I get "No input file specified." Instead of the standard 404
error. Is there a way to customize this?
Easy with Apache [1,2], with en ErrorDocument [1] directive.
Ex with this in a .htaccess (the FileInfo Override [3] is required)
containing this line:
ErrorDocument 404 /Lame
I am building a web based community forum type software using PHP. I am
currently working on how different user privelages are handled. Each
user is part of a group and each group has varying degrees of privelages.
I need to add in functionality which at the begginning of every script
check the
I think read from database better than from session, because it's more
easy than usnig session.
On Fri, 15 Oct 2004 00:41:31 -0700, Brendon <[EMAIL PROTECTED]> wrote:
> I am building a web based community forum type software using PHP. I am
> currently working on how different user privelages are
I was wondering what the difference is between the various PHP sites linked
to in this list, are they mirrors and what determines which site you get
directed to when doing a search from www.php.net?
http://www.php.net
http://uk.php.net
http://us2.php.net
and presumably others...
Thanks
Graham
> I don't know if this can running on mssql.
> select limit m,n
No, mssql can't do that. the only solution that i have is using
cursor, but I can't use codecharge to do that (and need much more time
to develop).
Thanks for your idea.
Best Regards,
Yusuf Tikupadang
--
PHP General Mailing Lis
> I don't know if this can running on mssql.
> select limit m,n
No, mssql can't do that. the only solution that i have is using
cursor, but I can't use codecharge to do that (and need much more time
to develop).
Thanks for your idea.
Best Regards,
Yusuf Tikupadang
--
PHP General Mailing Lis
Definitely store them in a session. A db lookup will mean a much heavier
and process intensive procedure.
Ian
On Fri, 2004-10-15 at 09:41, Brendon wrote:
> I am building a web based community forum type software using PHP. I am
> currently working on how different user privelages are handled. E
They're mirrors.
On Fri, 15 Oct 2004 09:20:10 +0100, Graham Cossey
<[EMAIL PROTECTED]> wrote:
>
> I was wondering what the difference is between the various PHP sites linked
> to in this list, are they mirrors and what determines which site you get
> directed to when doing a search from www.php.
Graham Cossey wrote:
I was wondering what the difference is between the various PHP sites linked
to in this list, are they mirrors and what determines which site you get
directed to when doing a search from www.php.net?
If you download you will be directed to a mirror, and that will then be
used a
To view the terms under which this email is distributed, please go to
http://disclaimer.leedsmet.ac.uk/email.htm
On 15 October 2004 10:00, Yusuf Tikupadang wrote:
> They're mirrors.
>
>
> On Fri, 15 Oct 2004 09:20:10 +0100, Graham Cossey
> <[EMAIL PROTECTED]> wrote:
> >
> > I was wondering
Do you even need a regex?
What about
if (strlen($_POST['mobile_number']) != 11 &&
substr($_POST['mobile_number'],0,3) != 447)
{
$error="Invalid Number";
}
On 15 Oct 2004, at 13:38, Shaun wrote:
Hi,
Could anyone help me with a reugular expression for a UK mobile phone
number?
So far I have tried
Hi,
Does anybody have any depthful knowledge of the SimpleXML extension in
PHP5?..
More accurately, do you know if the simpleXml->xpath() method uses DOM,
SAX or some other method of parsing a loaded XML document?
I ask because I am trying to parse arbitrary XML documents as efficiently
as possi
Hi,
Could anyone help me with a reugular expression for a UK mobile phone
number?
So far I have tried this but with no success
$regexp = "/^447[0-9]{9}$/";
if(!preg_match( $regexp, $_POST[mobile_number] )){
$error = "Invalid Mobile Number";
The number nust be 11 numbers long, be all num
On Fri, 2004-10-15 at 07:45, Gareth Williams wrote:
> Do you even need a regex?
>
> What about
>
> if (strlen($_POST['mobile_number']) != 11 &&
> substr($_POST['mobile_number'],0,3) != 447)
> {
> $error="Invalid Number";
> }
This doesn't verify that the portion following 447 is also a num
On Friday 15 October 2004 19:38, Shaun wrote:
> Could anyone help me with a reugular expression for a UK mobile phone
> number?
>
> So far I have tried this but with no success
>
>
> $regexp = "/^447[0-9]{9}$/";
> if(!preg_match( $regexp, $_POST[mobile_number] )){
> $error = "Invalid Mobile
Shaun wrote:
Hi,
Could anyone help me with a reugular expression for a UK mobile phone
number?
So far I have tried this but with no success
$regexp = "/^447[0-9]{9}$/";
if(!preg_match( $regexp, $_POST[mobile_number] )){
$error = "Invalid Mobile Number";
The number nust be 11 numbers long,
To view the terms under which this email is distributed, please go to
http://disclaimer.leedsmet.ac.uk/email.htm
On 15 October 2004 12:39, Shaun wrote:
> Hi,
>
> Could anyone help me with a reugular expression for a UK mobile phone
> number?
>
> So far I have tried this but with no success
Hi,
How can i add new items to an array without using an index.
Normally (single dimension) you can do: Arr[]="x" and this item is
added to the array, but what if i have subitems like:
Arr[]['name']="arnold"; Arr[]['address']="street".
This last example doesnt work and i think there will be a
On Fri, 2004-10-15 at 08:34, Arnold wrote:
> Hi,
>
> How can i add new items to an array without using an index.
> Normally (single dimension) you can do: Arr[]="x" and this item is
> added to the array, but what if i have subitems like:
> Arr[]['name']="arnold"; Arr[]['address']="street".
>
try $Arr[] = array('name' => 'arnold', 'address' => 'street');
Arnold wrote:
Hi,
How can i add new items to an array without using an index.
Normally (single dimension) you can do: Arr[]="x" and this item is
added to the array, but what if i have subitems like:
Arr[]['name']="arnold"; Arr[]['a
Try is_int($_POST['mobile_number']) or ctype_digit($_POST['mobile_number'])
HTH
Cheers
Chris
Robert Cummings wrote:
On Fri, 2004-10-15 at 07:45, Gareth Williams wrote:
Do you even need a regex?
What about
if (strlen($_POST['mobile_number']) != 11 &&
substr($_POST['mobile_number'],0,3) != 447)
{
$
You could add is_integer() into the if statement.
On 15 Oct 2004, at 14:07, Robert Cummings wrote:
On Fri, 2004-10-15 at 07:45, Gareth Williams wrote:
Do you even need a regex?
What about
if (strlen($_POST['mobile_number']) != 11 &&
substr($_POST['mobile_number'],0,3) != 447)
{
$error="Inva
Hi
On 15 Oct 2004 11:51:33 -, PHPDiscuss - PHP Newsgroups and mailing
lists <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Does anybody have any depthful knowledge of the SimpleXML extension in
> PHP5?..
>
> More accurately, do you know if the simpleXml->xpath() method uses DOM,
> SAX or some other m
test
--
c3f7bc9d7683857572da3d1fa3d31af17bde4ebbc5c0f0dc2b7f6f
skip the two step process and use RAND in the sql statement
SELECT * FROM table1, table2 WHERE a=b AND c
bastien
From: -{ Rene Brehmer }- <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED],[EMAIL PROTECTED]
Subject: [PHP-DB] How to optimize select of random record in DB ?
Date: Fri, 15 Oct 2004 07:41:44 +02
Cosmin wrote:
test
Had this been a real email, we would have been given instructions on how
to reply. This has been a test of the emergency php email broadcast system.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsu
Hi!
I need someone who is very good with maths to help me
with this, unfortunatly I suck at maths so that
someone can not be me. Ironically before I started my
first computer course years back I asked the
instructer if "learning computers needed a lot of
maths...she said 'no, just basics'"..that ai
Problem 1)
$h_1 = 600;
$w_1 = 800;
$h_2 = 120;
$w_2 = $w_1 * ($h_2 / $h_1);
Problem 2 a)
Assuming you're wanting the central portion of the original image (which
I think you are from what you've written)
$h_1 = 600;
$w_1 = 800;
$h_2 = 120;
$w_2 = 90;
$x = ($h_1 - $h_2) / 2;
$y = ($w_1 - $w_2) / 2
Good questions.. Here's some stuff to play with:
> Heres my maths problems in 2 parts:
>
> Problem 1)
> I need to scale down an image (eg: example.jpg) to
> height of 120 pixels while maintaining the images
> proportions.
>
> eg:
> if i have an image of (height and width) 800x600 what
> would th
DAMN!
2 minutes after posting to the list I get some pretty
good mails from two people with answers on how to
solve this,while i had a restless night trying to
figure this out in my head! I LOVE THIS LIST!
Thanks guys, will tell you how this goes and if i have
any problems.
Cheers,
Mag
=
---
> You mean like this...
> $sub = array
> (
> 'name' => 'Ahnold',
> 'address' => '123 Someplace Nice',
> );
>
> $bigArray[] = $sub;
Something else that will work is the following:
$arrPt =& $Arr[];
$arrPt['name'] = 'bob';
$arrPt['address'] = 'wherever';
thnx,
On Fri, 15 Oct 2004 12:42:21 +0700, Yusuf Tikupadang
<[EMAIL PROTECTED]> wrote:
> I'm a new member in this mailing list.
> I have a problem with large data in mssql (more than 100.000 record in
> one table). If I want to browse it from record 10 until 19 (like when
> I press next button), php have
Very helpful indeed. Until today I had used softwares like Photoshop
to get the exact proportion rate. This really works, thank you guys.
Cheers !!!
On Fri, 15 Oct 2004 07:05:34 -0700 (PDT), Mag <[EMAIL PROTECTED]> wrote:
> DAMN!
> 2 minutes after posting to the list I get some pretty
> good mail
Thank you for the tips and the help. I really appriciate it. You
have given me something that I can use to learn regular expressions.
Thanks,
Robert
On Fri, 15 Oct 2004 11:04:57 +0800, Jason Wong <[EMAIL PROTECTED]> wrote:
> On Friday 15 October 2004 10:35, Robet Carson wrote:
>
>
> > need a
it's algebra at work :)
nicely done.
On Oct 15, 2004, at 8:57 AM, Gryffyn, Trevor wrote:
Good questions.. Here's some stuff to play with:
Heres my maths problems in 2 parts:
Problem 1)
I need to scale down an image (eg: example.jpg) to
height of 120 pixels while maintaining the images
proportions.
> Also if someone could direct me to a site that explains how to use and
> create regexp in a small minded manor since I have been unable to
> grasp the concepts.
the regex coach has been a big help to me
http://www.weitz.de/regex-coach/
you might find it useful
--
PHP General Mailing List (h
Algebra! I aced that in 7th grade! (don't ask me about all the other
years of math. Haha.. I think I just got bored and slept a lot or
something)
-TG
> -Original Message-
> From: Jonel Rienton [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 15, 2004 11:02 AM
> To: Gryffyn, Trevor
> C
Hi.
I'm setting up a credit card payment app. When I send the information
through the form I get a result similar to this:
NOT CAPTURED:00:428930479495:NA:1015:9755676331042890:1:1
This is the only data in the result page.
I have never done parsing, and I have no idea of how to get thi
* Thus wrote Quanah Gibson-Mount:
> I see that php 5.0.2 has added the "ldap_sasl_bind" function. I compiled
> php-5.0.2 against our OpenLDAP w/ SASL support libraries, and went ahead to
> give it a whirl:
> ...
> However, what I get back is:
>
> Warning: ldap_sasl_bind() [ href='function.lda
> I'm setting up a credit card payment app. When I send the information
> through the form I get a result similar to this:
>
> NOT CAPTURED:00:428930479495:NA:1015:9755676331042890:1:1
>
> This is the only data in the result page.
>
> I have never done parsing, and I have no idea of how
> http://us2.php.net/manual/en/function.preg-split.php
>
> should do it
also http://us2.php.net/explode
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
How come you guys always go for the simplest answer? why not do something like,
$num = count($arrPt);
$arrPt[$num]['name'] = "Figntin' Bob";
$arrPt[$num]['address'] = "Under the Broad Street Bridge";
Live a little...
-Jasper
On Fri, 15 Oct 2004 09:07:43 -0500, Chris Boget <[EMAIL PROTECTED]> w
Hi again guys, :-)
Thanks to the educated (and excellient) help of Chris
and trevor I am now getting proportionate thumbs
(which was "problem 1", remember? )
Heres the code that i am using, if it may help anyone
else:
** code start **
$src_img = imagecreatefromjpeg("tgp1.jpg");
$img_dim = getima
On Thu, 14 Oct 2004 16:30:42 -0400, Don <[EMAIL PROTECTED]> wrote:
> Has anyone had any luck installing with the --with-imap configuration
> option. IMAP doesn't seem to be installed (nor imap-devel) and the c
> library specified in the docs at php.net does not compile.
I am also trying to do th
Thanks!
On Fri, 15 Oct 2004 10:06:15 -0500, Matt M. <[EMAIL PROTECTED]> wrote:
> > Also if someone could direct me to a site that explains how to use and
> > create regexp in a small minded manor since I have been unable to
> > grasp the concepts.
>
>
> the regex coach has been a big help to me
Thank you Matt and Ed.
I have solved the issue and started looking into parsing and regular
expressions.
Thx
Carlos.
On Fri, 15 Oct 2004 10:57:02 -0500, Matt M. <[EMAIL PROTECTED]> wrote:
> > http://us2.php.net/manual/en/function.preg-split.php
> >
> > should do it
>
>
> also http://us2.php.
Hi,
I am working on setting up a VPOS system, and I need to read the
results of sending the CC information to the bank.
When sending the form I am doing it with HTTPS port 443 with POST
method in my form and application/www-form-urlencoded
When I get the results of my submission I get another ht
My interpretation of Problem 2 before was that you wanted to get a 120w
x 90h (?) section of the original image, not of the thumbnail you
generated by resizing the original.
You seem to be working off of the adjusted height.
Sorry, I didn't noodle all the way through this one, what I am missing?
Hello,
On 10/15/2004 02:24 PM, Carlos Alberto Bazan-Canabal wrote:
I am working on setting up a VPOS system, and I need to read the
results of sending the CC information to the bank.
When sending the form I am doing it with HTTPS port 443 with POST
method in my form and application/www-form-urlenco
Hi Trevor,
Sorry, am just a bit confused myself mostly because I
am using a third party script to clip the 120x90 part
out of the image...understanding the way the script is
written is a little frustrating as it was written for
something else and I am trying to adopt it.
if you want to try your h
No worries. But here's my thought:
1. You start with an image, getting it's current (original) proportions
2. You figure out the width and height proportions to resize it down to
something small
3. Resize image (creating a new image.. At least to send to the browser
if not in a file separate from
Is there a function for print window in php? I tried javascript
window.print() but this doesn't work in ie 5.2 on mac. Thanks.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Web standards my friend.
Use CSS, learn from the master: http://www.alistapart.com/articles/goingtoprint/
-Original Message-
From: Tony Kim [mailto:[EMAIL PROTECTED]
Sent: Friday, October 15, 2004 3:10 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Print window function???
Is there a function
I think you've a couple of problems with your second problem (problem
problem problem).
First of all, you're setting $dst_h to 0, which gives you a height of 0
- IIRC that's not what you wanted :)
You should be setting that $dst_h = 120 as you always want it to be 120px
I reckon that your code
Hey Chris,
Thanks for replying.
Dont worry about it, I got so p*ssed that I just
striped the whole thing down to pretty much just the
imagecopyresized() function, fiddled around with it to
see how it works and got the sh*t working. The good
thing now is I understand a bit better how the
function
Hi.
I am currently working on a project that the script should print-out
documents whenever local users wishe to print-out.
However, my concern is how to detect THE printer is ready to print out NOT
only its driver is installed.
Thank you in advance.
CK
--
PHP General Mailing List (http://w
On Fri, 15 Oct 2004 10:49:27 -0600, Brad Pauly <[EMAIL PROTECTED]> wrote:
>
> I am also trying to do this. Dovecot is the default IMAP server on
> FC2. I haven't had time to try it yet, but here is a link I found
> about compiling PHP with dovecot:
>
> http://www.dovecot.org/list/dovecot/2004-Jul
Thanks, I will try it first
On Fri, 15 Oct 2004 09:26:21 -0500, Greg Donald <[EMAIL PROTECTED]> wrote:
> http://pear.php.net/package/DB_Pager
>
> --
> Greg Donald
> Zend Certified Engineer
> http://gdconsultants.com/
> http://destiney.com/
--
PHP General Mailing List (http://www.php.net/)
To u
Hello,
I have an app where one module is similar to
phpMyAdmin (well only .1%) with error_reporting() set
to E_ALL.
Now a user can execute any query. What is the best way
to know whether a query is result or non-result.
e.g.
>>
$result = mysql_query ( $query, $mysql );
if
Karam Chand wrote:
Hello,
I have an app where one module is similar to
phpMyAdmin (well only .1%) with error_reporting() set
to E_ALL.
Now a user can execute any query. What is the best way
to know whether a query is result or non-result.
e.g.
. . .
Thanks in advance
Regards,
Karam
As it st
63 matches
Mail list logo