Re: [PHP-WIN] how to avoid repetition?

2005-06-09 Thread graeme
, since database have good sorting algorithms and are designed to manage large numbers. graeme. bo wrote: I need to generate 10million 12-char string and I am able to do so, however the problem is how to avoid repetition keeping each string unique? it will be a disaster to compare each string

Re: [PHP-WIN] what's wrong with this while loop?

2005-06-07 Thread graeme
le is okay then enter the while loop, close the file after the loop. That should male you code a bit clearer (and avoid 50 million file writes!!!). Next indent appropriately that will make it is easy to see what is going on. graeme. bo wrote: Following my code is to write a 15digit random

Re: [PHP-WIN] Database Problem

2005-05-20 Thread graeme
t;"; $result = mysql_query($SQL,$connection); 2) Check on the result returned from MySQL. try the last successful and the first failed query through the command line. You might learn something, at least I hope you do! all the best, graeme. John wrote: I have code that querys a mysql server a

Re: [PHP-WIN] Re: Jaw Breaker - What's the ansewer?

2005-04-21 Thread graeme
helps, graeme JC Botha wrote: Hi Jin, Yes that also buged me, had no idea why it does that. I also battled with this one for a while. Perhaps there are more on the mailing list that got some info on this technical point. Thanks for your intrest! Chris On 4/21/05, Wu, Jin Yong <[EMAIL PROTECTED]> wro

Re: [PHP-WIN] Re: Jaw Breaker - What's the ansewer?

2005-04-20 Thread graeme
inary, a rational fraction in binary. graeme. JC Botha wrote: It is possible, and "10.642868165785" is incorrect. The question says "$x is a number between 1 and 10 and has 2 decimal places." Try again, if more try then I will post the source code that generates the asnwer?

Re: [PHP-WIN] Re: Jaw Breaker - What's the ansewer?

2005-04-20 Thread graeme
Well the closest I got was $x = 8.36 but that only gave 4277126.8 So is this question dependent upon the floating point arithmetic that is used? graeme JC Botha wrote: It is possible, and "10.642868165785" is incorrect. The question says "$x is a number between 1 and 10 and has 2

Re: [PHP-WIN] PHP5 and MySQL

2005-04-15 Thread graeme
phpinfo() displayed. hope this helps. graeme. JC Botha wrote: Ok, I did the phpinfo() and only the SQLlite is listed there, no MySQL is listed. I did enable the php_mysql.dll and set the windows path to c:\php. What else it there that I can look at. Thanks for all the links sent to me, I read them a

Re: [PHP-WIN] Optimize php code

2005-04-06 Thread graeme
roved?" Obviously there is no universal panacea. graeme. martin hochreiter wrote: Hi there! I'm not the experienced php user, but I've been using php for a while and I've already written some bigger applications with it. These bigger applications are the 'problem', I k

Re: [PHP-WIN] Session Variables

2005-03-07 Thread graeme
Also use $_SESSION rather than HTTP_SESSION_VAR. Mike wrote: You need to make sure that in your second page that you're starting the session - if you don't do this then that second page will never have access to those session variables. -M -Original Message- From: Richard Duval [mailto

Re: [PHP-WIN] Validation of Primary Key Datetime variable

2005-02-28 Thread graeme
To reiterate what others have said avoid user input as your primary key, an auto increment would be better. But to get back to your validation problem, you might want to look up the strtotime() function graeme. S.D.Price wrote: Thanks for this George. I am populating the datetime field from

Re: [PHP-WIN] Timed redirection

2005-01-30 Thread graeme
Hi, I've not done what you want but if I understand you correctly then it is possible with the HTTP redirect header. A Quick google should help out. graeme Jim MacDiarmid wrote: Is there a way to programmatically add timed redirection to a page? I have a page with a form on it. Once

Re: [PHP-WIN] Re: Output Image from Db to Browser

2005-01-18 Thread graeme
r; ... and then close the database connection and other tidying up tasks... As I said it's straight from the book, so I hope it helps! graeme MikeA wrote: I had tried that once but then I was requested the download the file. But I gave your suggestion a shot and I am getting an error message s

Re: [PHP-WIN] I am trying to write & read to a file

2005-01-17 Thread graeme
Here are a few steps to try: Go to your favourite text editor and open the file, what do you see? If the contents are there then go back to your script and read the file using *file_get_contents(filename)* graeme Patrick Roane wrote: I created a form that asks for the users 1st and last name. I

Re: [PHP-WIN] Output Image from Db to Browser

2005-01-17 Thread graeme
try to look it up for you. But this should at least get you going on testing getting your image from the database. graeme MikeA wrote: I am trying to output a JPG image to the browser without creating a file. I have tried several things but nothing seems to work. I sure could use a whole lo

Re: [PHP-WIN] Newbie question: convert string to int

2005-01-17 Thread graeme
If you note in my text I had said number. 5.7 is a number. If you want to convert the number to an integer then there are a number of php functions to do that. It all depends on how you want the conversion to be done but a type cast (int) will eventually be necessary. graeme BENJAMIN LAMBE

Re: [PHP-WIN] Newbie question: convert string to int

2005-01-16 Thread graeme
ou'll need to write your own function for that. graeme Louis Young wrote: Hi there What's the function to convert a string to an int. Cheers Louis -- Experience is a good teacher, but she sends in terrific bills. Minna Antrim -- PHP Windows Mailing List (http://www.php.net/) To unsubscr

Re: [PHP-WIN] a function question

2004-12-30 Thread graeme
The function strpos might be better, preg_match is a bit of overkill if (strpos($mail,'@') == false) // error message else // okay message graeme. Dean Hayes wrote: Try this i got this working without any problems prints everything out nice an neetly global $user; gl

Re: [PHP-WIN] About "\n"

2004-12-29 Thread graeme
use a tag, or equivalent such as a pair. graeme. [EMAIL PROTECTED] wrote: >Hi > > I'm new in php, I find the "\n" dosen't work in my machine > > > > >echo "Hello World!"; >?> > > > > >First PHP page > >echo "

[PHP-WIN] Is session held in the cache?

2004-11-09 Thread graeme
dead) in a cache waiting to walk again? session_start(); $_SESSION = array(); if (isset($_COOKIE[session_name()])) { setcookie(session_name(), '', time()-42000, '/'); } session_destroy(); I've tried adding a call to session_write_close(); but no joy. Any advice would

Re: [PHP-WIN] Convert Nominal Number into string spelling in PHP

2004-10-06 Thread graeme
e echo $number; echo ""; var_dump($digit); echo ""; ?> graeme susilo wrote: Does everyone know how to convert Nominal Number into string spelling in PHP ?. Like this : Nominal Number : 567.123.560 And the spelling string/word have to be like this : "Five Hundred Sixty