[PHP-DB] Re: Polls?

2002-11-08 Thread Adam Royle
Hello, I created a (very) simple class for a polling system. I only developed it to a certain stage (took me a few hours). This was how you used it: $poll = new easyPoll("poll_name"); $poll->PrintVotingPanel(); ?> and if you wanted to show all the results of all polls $poll = new easy

[PHP-DB] Re: multiple mysql query in PHP mysql_query?

2002-11-08 Thread Qunfeng Dong
Thanks a lot! Great quick help!!! --- Paul DuBois <[EMAIL PROTECTED]> wrote: > >I don't know how to merge all the results from each > >mysql_query. > > > >$result1 = mysql_query("CREATE temporary table > >tempTable ..."); > >$result2 = mysql_query("insert ..."); > >... > >$resultn-1 = mysql_query

RE: [PHP-DB] multiple mysql query in PHP mysql_query?

2002-11-08 Thread John W. Holmes
> Hi, Can anybody give me a simple example of using > PHP's mysql_query to perform mulitple mysql queries. > I am using MySQl 3.23, trying to use create temporary > table and insert ... select to overcome the lack of > union operation in that verion of MySQL. > Thanks! Mysql_query() can only do on

[PHP-DB] multiple mysql query in PHP mysql_query?

2002-11-08 Thread Qunfeng Dong
Hi, Can anybody give me a simple example of using PHP's mysql_query to perform mulitple mysql queries. I am using MySQl 3.23, trying to use create temporary table and insert ... select to overcome the lack of union operation in that verion of MySQL. Thanks! Qunfeng Dong _

Re: [PHP-DB] indexing on existing DB

2002-11-08 Thread Maxim Maletsky
But, remember - you don't rebuild completely an index - you rather add to it. So, there are three scenarios: 1. Q: You create the table to then send into it lots of data row per row A: create the table first, then build an idex on it once. 2. Q: You have to constantly be adding the data i

RE: [PHP-DB] indexing on existing DB

2002-11-08 Thread John W. Holmes
> In MySQL, is there any difference between creating an index at table > creation time, and creating an index on an existing table? Does an index > created on an existing table re-index itself after each insert/update, or > does it only index itself once - when you create the index? In the end, i

Re: [PHP-DB] Re: ROugh idea of speed

2002-11-08 Thread Maxim Maletsky
> > d.. 20 GB traffic/month > > e.. RedHat LInux 7.2 > > Red Hat Advanced Server is better - it has Oracle patches for better > asynch i/o performance. If for Oracle, I'd then recommend SuSe. -- Maxim Maletsky [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To uns

[PHP-DB] Re: ROugh idea of speed

2002-11-08 Thread John Lim
Hi, I've dealt with databases with about 100 million records (100Gb of data/indexes), using Oracle, and i'm glad we did. If you database is 5 times larger than our largest one, you definitely you need Oracle or something high end. "Steve Vernon" <[EMAIL PROTECTED]> wrote in message news:030801c28

Re: [PHP-DB] Search and Replace

2002-11-08 Thread Marco Tabini
It should be fairly easy. Write a php script that loads your source file in memory and then substitute your values, then save it to disk. There was a thread between Jonathan Sharp and myself in the PHP mailing a week or so ago--if you check the archives you should find it pretty easily--Jonathan's

Re: [PHP-DB] Polls?

2002-11-08 Thread Mihail Bota
Leif, off the wall...what if you have a table for question, identified with an unique ID, and another where you store the results? BTW: how are the questions? Yes/No, or multiple choices, or combination of these two styles? On Fri, 8 Nov 2002, Leif K-Brooks wrote: > The problem is, I need to ma

Re: [PHP-DB] Polls?

2002-11-08 Thread Leif K-Brooks
The problem is, I need to make a page that shows all of the polls, and one query per poll would kill the server. Peter Beckman wrote: Use the dual table questions and answers suggestion before. Then just use a loop: $question = mysql_query("select * from questions where id={$this_question}");

[PHP-DB] Search and Replace

2002-11-08 Thread Ryan Holowaychuk
I am trying to do a search and replace into a text file that will then get saved to a new name once the info has been replaced. So I have been able to do this with simple ..['name'] variable replace. But how do I get it to save the results into a text file. Program work Flow - for creating a PD

RE: [PHP-DB] Order DB through url toggle

2002-11-08 Thread Paul Ihrig
Thanks Guys.. This seemed to do the trick /* and the desc asc */ $dir = ((isset ($_GET['dir'])) ? (int) $_GET['dir'] : 1); if (!$dir) $dir = ($dir ? 0 : 1); if ($HTTP_GET_VARS['dir'] == 0) { $diri = 'DESC'; } if ($HTTP_GET_VARS['dir'] == 1) { $diri = 'ASC'; } mysql_select_db($databas

Re: [PHP-DB] Polls?

2002-11-08 Thread Peter Beckman
Use the dual table questions and answers suggestion before. Then just use a loop: $question = mysql_query("select * from questions where id={$this_question}"); while ($r = mysql_fetch_array($question)) { $answers = mysql_query("select * from answers where qid={$r[id]}"); while ($s = mysql_f

Re: [PHP-DB] ROugh idea of speed

2002-11-08 Thread Peter Beckman
I was running a site on a dual 800 CPU, 1GB ram, dual mirrored 18GB drives, doing about 16.8GB per day on average, including PHP/HTML code. The system had several tables (~20), some regularly accessed, some not. The biggest table was a log table of about 2.5+ million rows. Ran reports from it wit

RE: [PHP-DB] Order DB through url toggle

2002-11-08 Thread Marco Tabini
I think you might be missing a = sign in your if statement. Marco - php|architect -- The Monthly Magazine For PHP Professionals Come visit us on the web at http://www.phparch.com! On Fri, 2002-11-08 at 11:26, Paul Ihrig wrote: > well i tried that.. > > but it out puts the right nu

Re: [PHP-DB] Order DB through url toggle

2002-11-08 Thread Jason Wong
On Saturday 09 November 2002 00:26, Paul Ihrig wrote: > well i tried that.. > > but it out puts the right number. > but it is not taking that var to switch ACS or DESC... > > http://localhost/php/default2.php?orderBy=priLastName&dir=0 > http://localhost/php/default2.php?orderBy=priLastName&dir=1 >

RE: [PHP-DB] Order DB through url toggle

2002-11-08 Thread Paul Ihrig
well i tried that.. but it out puts the right number. but it is not taking that var to switch ACS or DESC... http://localhost/php/default2.php?orderBy=priLastName&dir=0 http://localhost/php/default2.php?orderBy=priLastName&dir=1 /* here we set up out order by clause */ $orderBy = 'priLastName';

Re: [PHP-DB] ROugh idea of speed

2002-11-08 Thread Jason Wong
On Friday 08 November 2002 23:08, Maxim Maletsky wrote: > "Steve Vernon" <[EMAIL PROTECTED]> wrote... : > > Hiya, > > Just wondering what is the rough idea of speed of a server like this > > is holding a database with millions of records. I know its difficult, > > depends on the data stored etc

Re: [PHP-DB] indexing on existing DB

2002-11-08 Thread Marco Tabini
Except when you have a million records, which may take a few seconds to build. :-) Marco - php|architect -- The Monthly Magazine For PHP Professionals Come visit us on the web at http://www.phparch.com! On Fri, 2002-11-08 at 11:12, Maxim Maletsky wrote: > > Index is always re-index

Re: [PHP-DB] indexing on existing DB

2002-11-08 Thread Maxim Maletsky
Index is always re-indexing itself on INSERT/UPDATE. Roughly, I don't think there is any difference in when you create an index before or after table is populated. -- Maxim Maletsky [EMAIL PROTECTED] "Jason Vincent" <[EMAIL PROTECTED]> wrote... : > (I know this is more of a mySQL question th

RE: [PHP-DB] Variables

2002-11-08 Thread Hutchins, Richard
It would seem that your IF statement, as it is written below, evaluates to true every time because I'm guessing that the hexadecimal value of the string timeb is larger than the hexadecimal value of timea. Like I said, just a guess. I'm also guessing that you actually want to compare two values fr

[PHP-DB] indexing on existing DB

2002-11-08 Thread Jason Vincent
(I know this is more of a mySQL question than PHP, but allow me this one if you would...) In MySQL, is there any difference between creating an index at table creation time, and creating an index on an existing table? Does an index created on an existing table re-index itself after each insert/up

Re: [PHP-DB] Order DB through url toggle

2002-11-08 Thread Marco Tabini
Let's see: Last Name This is the general idea. $dir will toggle between 1 and 0. There are more "compact" ways of writing this--but this one should be clearer. Marco - php|architect -- The Monthly Magazine For PHP Professionals Come visit us on the web at http://www.phparch.com!

[PHP-DB] Order DB through url toggle

2002-11-08 Thread Paul Ihrig
Hello All! i am new to the list & to PHP.. So i have a recordset that displays my contacts in a table. the headers of the columns look like this. Last Name so when a user clicks on it It will Re-Sort the rs by priLastName Asc. what i want to do is make it a toggle between table name ASC or DES

Re: [PHP-DB] ROugh idea of speed

2002-11-08 Thread Maxim Maletsky
"Steve Vernon" <[EMAIL PROTECTED]> wrote... : > Hiya, > Just wondering what is the rough idea of speed of a server like this is > holding a database with millions of records. I know its difficult, depends > on the data stored etc. Also rather the design and, whether do you really need to sto

Re: [PHP-DB] Array question

2002-11-08 Thread Maxim Maletsky
to precise: $array = Array('name'=>'Maxim', 'surname'=>'Maletsky'); unset($array['name']); // now array has this structure: // Array('surname'=>'Maletsky') -- Maxim Maletsky [EMAIL PROTECTED] Jason Wong <[EMAIL PROTECTED]> wrote... : > On Friday 08 November 2002 17:25, nikos wrote: > > Doe

Re: [PHP-DB] How to list Oracle table names

2002-11-08 Thread Maxim Maletsky
SELECT * FROM user_tables; will give you the list of tables and properties. I think the table name's columns is called: 'table_name' so this should be: SELECT table_name FROM user_tables; -- Maxim Maletsky [EMAIL PROTECTED] [EMAIL PROTECTED] wrote... : > I'm very new at this. Can I list

RE: [PHP-DB] textarea!!

2002-11-08 Thread Snijders, Mark
check out the nl2br() function!! good luck -Original Message- From: Siamak Sadeghianfar [mailto:siamak116@;hotmail.com] Sent: vrijdag 8 november 2002 15:31 To: [EMAIL PROTECTED] Subject: [PHP-DB] textarea!! Hi I've written a guestbook in php user writes a message in a texarea and i

Re: [PHP-DB] textarea!!

2002-11-08 Thread Marco Tabini
You need to use nl2br http://ca.php.net/manual/en/function.nl2br.php Marco - php|architect -- The Monthly Magazine For PHP Professionals Come visit us on the web at http://www.phparch.com! On Fri, 2002-11-08 at 09:30, Siamak Sadeghianfar wrote: > Hi > I've written a guestbook in ph

[PHP-DB] textarea!!

2002-11-08 Thread Siamak Sadeghianfar
Hi I've written a guestbook in php user writes a message in a texarea and in the code I insert it in a table and then in showpage I sow it to him.before I insert the message into table , I use addslashes() and htmlspecialchars(). the prblem is that , when I retrieve the message from the table al

[PHP-DB] Variables

2002-11-08 Thread Steve Dodkins
Hi The following will print the variables ($tim1 and $tim2) correctly but the IF statement using the same vars will not work, it will only work as below which seems to work by comparing the text values of the 2 variables $tim1 $tim2. while($myrow = mysql_fetch_array($result)) { $tim1="timea"; $t

[PHP-DB] ROugh idea of speed

2002-11-08 Thread Steve Vernon
Hiya, Just wondering what is the rough idea of speed of a server like this is holding a database with millions of records. I know its difficult, depends on the data stored etc. Its basically storing an index int and about 5 or so char field (50 long). In total I want to store 500 million r

Re: [PHP-DB] Array question

2002-11-08 Thread Jason Wong
On Friday 08 November 2002 17:25, nikos wrote: > Does anybody know how to remove an item from an array? > Let's say > > $array('banna', 'apple','cherry') > foreach ($array as $value) { > if ($value=='chery') DELETE $value FROM $array > ... unset(). -- Jason Wong -> Gremlins Associates -> ww

[PHP-DB] Array question

2002-11-08 Thread nikos
Does anybody know how to remove an item from an array? Let's say $array('banna', 'apple','cherry') foreach ($array as $value) { if ($value=='chery') DELETE $value FROM $array ... Thanks