Search found 129 matches

by Archy
Tue May 24, 2005 4:12 pm
Forum: PHP - Code
Topic: MSN via php
Replies: 15
Views: 3498

Hmm, how about CGI:IRC?
by Archy
Tue May 24, 2005 2:58 pm
Forum: PHP - Code
Topic: MSN via php
Replies: 15
Views: 3498

by Archy
Tue May 24, 2005 2:19 pm
Forum: PHP - Code
Topic: [SOLVED]Easy sum...
Replies: 10
Views: 2157

Wasnt sure what you wanted achieved. Untested. <?php include('ban.php'); include('config.php'); $SQL_statement = "SELECT * FROM countries"; $resultset = mysql_query($SQL_statement); $totalpower = 0; while ($data = mysql_fetch_array($resultset)) { $land = $data['country']; $ding2 = "SE...
by Archy
Fri May 20, 2005 8:38 am
Forum: PHP - Code
Topic: Whos Online - Cookies?
Replies: 8
Views: 843

I would personally add the delete function into a cron job, and run it every hour. However, it would really depend on how active your site was.
by Archy
Tue May 03, 2005 10:05 am
Forum: PHP - Code
Topic: Occurrences within an array
Replies: 4
Views: 482

Yes, I saw that prior to coming here, but it just gives you a list, similay to print_r($array);. I looked on PHP.net, but couldnt find anything helpful, and just wondered if anyone had done anything like this before.
by Archy
Tue May 03, 2005 9:19 am
Forum: PHP - Code
Topic: Occurrences within an array
Replies: 4
Views: 482

Occurrences within an array

Hi, I'm currently having a small problem in finding out how many times a string occurs in an array - without looping through and testing every element within it. For instance $animals = Array = ('Dog', 'Cat', 'Dog', 'Goldfish', 'Dog', 'Bear', 'Cat'); So, if I did a search for 'Dog', it would return ...
by Archy
Sat Mar 19, 2005 6:20 pm
Forum: PHP - Code
Topic: Battle Formula
Replies: 12
Views: 2282

I would use a while statement, and keep looping it until one of the players dies. To see whos player's turn it is, I would look at the current battle turn, and use a formula to see whos go it should be, and then let that person have his go. Once (s)he has had his/her go, the loop continues. Too late...
by Archy
Sat Mar 19, 2005 6:13 pm
Forum: Databases
Topic: Manipulating new generated column
Replies: 6
Views: 614

Hmm, yup, just me being stuid : )
by Archy
Fri Mar 18, 2005 9:00 am
Forum: Databases
Topic: Manipulating new generated column
Replies: 6
Views: 614

I already have the sub total of the row, but I need to get the total of all the rows that are outputted.
by Archy
Fri Mar 18, 2005 8:15 am
Forum: Databases
Topic: Manipulating new generated column
Replies: 6
Views: 614

Well, at the moment, I have the quantity, and the the price in the table at the moment, and I generate the subTotal by using:

item.qty*item.price AS subTotal

However, whenever I try and make reference to subTotal as a column, it just says that the column cannot be found.
by Archy
Fri Mar 18, 2005 6:05 am
Forum: Databases
Topic: Manipulating new generated column
Replies: 6
Views: 614

Manipulating new generated column

My SQL query creates a new column from supplied data - quantity, and cost of item, so you are left with the generated column subTotal. However, I cannt refer to this column to do anything with it - I want to add up all of the subTotal columns and produce a total at the bottom. Does anyone know of ho...
by Archy
Fri Feb 18, 2005 4:50 pm
Forum: PHP - Code
Topic: [SOLVED] Replace only one instance
Replies: 3
Views: 1333

Thanks markl999, worked well.
Thanks for trying to help wwwapu, although as you said, it would be more resource demanding.

" substr_replace -- Replace text within a portion of a string "

Brain didnt register that "portion of a string" bit. : )
Thanks.
by Archy
Fri Feb 18, 2005 4:31 pm
Forum: PHP - Code
Topic: [SOLVED] Replace only one instance
Replies: 3
Views: 1333

[SOLVED] Replace only one instance

Is there a way to only replace 1 instance of a string within a string. For instance: $string = "The house is made of bricks bricks."; Is there a way to only take out the first "bricks" within that string. Please bare in mind that the string could be anything, of any length. Thanks.
by Archy
Wed Feb 16, 2005 10:10 am
Forum: Databases
Topic: Optimisation
Replies: 7
Views: 1385

That's what I thought. The queries are only very basic.

Thanks.
by Archy
Wed Feb 16, 2005 9:27 am
Forum: Databases
Topic: Optimisation
Replies: 7
Views: 1385

Sorry, I made a mistake in my other post, I meant (And is corrected in my previous post):

- Get 3 columns from a database via 1 query, or
- Get 3 rows from a database via 3 seperate queries.

Thanks.