[PHP-DB] Re: Extracting data from Arrays in ISAM table

2007-05-20 Thread itoctopus
Step #1: Select name_field FROM the_table;
Step #2:
$arr_all_names = array();
foreach single_result in your result_set{ //you have to translate this into 
php
$arr_name = explode(',', $single_result['name']); //assuming that you 
are joining names in the field using a comma
$arr_all_names = $arr_all_names + $arr_name;
}
//remove redundancy
$arr_all_names = array_unique($arr_all_names);
//now sort the array
sort($arr_all_names);
//now all you have to do is to loop through the array to display it on your 
site



-- 
itoctopus - http://www.itoctopus.com
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]
I have a table with between 100k and 200k rows.  One field, `names`, is
 populated, in each row, with an imploded array of up to 4 names.

 I require to create a list of names, without repeats, of all the names
 in `names` field to use in an html form.

 Any advise would be appreciated.  I have no ideas on how to start.

 Louise



 

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



[PHP-DB] Re: MySQL 0 index date and time functions (mode or typo)?

2007-05-18 Thread itoctopus
Hey,
I think this table is self-explanatory:

  First day
  Mode of week Range Week 1 is the first week .
  0 Sunday 0-53 with a Sunday in this year
  1 Monday 0-53 with more than 3 days this year
  2 Sunday 1-53 with a Sunday in this year
  3 Monday 1-53 with more than 3 days this year
  4 Sunday 0-53 with more than 3 days this year
  5 Monday 0-53 with a Monday in this year
  6 Sunday 1-53 with more than 3 days this year
  7 Monday 1-53 with a Monday in this year


-- 
itoctopus - http://www.itoctopus.com
Dwight Altman [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 In MySQL, regardless of the documentation version,
 http://dev.mysql.com/doc/refman/4.1/en/date-and-time-functions.html#function
 _week I've seen the explanation for receiving a 0 from the WEEK function
 depending on the mode setting which causes a range between 0-53.

 But what about:
 DAYOFMONTH 0 to 31
 MONTH 0 to 12

 I was wondering if 0 may be for invalid dates, but I get NULL for the
 following invalid date:
 SELECT MONTH( '1998-14-03' ), DAYOFMONTH( '1998-14-03' )

 When might I receive a 0 for these two functions?


 Regards,
 Dwight 

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



[PHP-DB] Re: MySQL Query on the Fly

2007-05-12 Thread itoctopus
You have to use an iframe to do what you want. Once the user select
something, you referesh the iframe and you pass specific parameters to it
based on the user's choice.

-- 
itoctopus - http://www.itoctopus.com
Todd A. Dorschner [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
Good Morning,



I've been searching and toying with this solution for some time but
can't find that right answer.  Looking for solutions/suggestions to the
following:



I created a program that will allow people to track sales and depending
on what they've sold, they will either get a set bonus, or a bonus based
on a percentage.  I have no problem creating a drop down box for them to
select from, and I could probably create a select button that would do
the action, but I'd rather have it in one step.  So what I'm trying to
do is somehow when they select from the drop down (via a JavaScript
onchange or something) I'd like it to pull data from the MySQL database.
I'd like it to pull the amount and then each or per based on the ID of
what they've selected from the drop down.  If it was always based on
each sale or based on a percentage, that would be easy as I could code
that into the drop box, but I'd like to keep it based on the ID so that
it can pull out of the database the name, and then when changed pull the
info.  Any ideas?  Thanks in advance for the help.  If you have any
questions or it seems like I left something out, please let me know.





Thank you for your time,


Todd Dorschner

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



[PHP-DB] Re: Read more link with HTML code

2007-05-07 Thread itoctopus
Put your 200 characters in a table block:
table
tr
td
Your 200 characters
/td
/tr
/table

-- 
itoctopus - http://www.itoctopus.com
Mike van Hoof [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hello list,

 I got a problem with displaying content in a read more block which 
 contains HTML code.
 The problem is as followes:

 I got a large piece of content, which contains HTML code (bui etc), 
 but after 200 characters a read more link appears. At the moment I strip 
 al the HTML out of this piece of content, and display the full set off 
 content on another page.
 But now i also want to display the bold text etc. in the first (200 chrs) 
 content block. The only problem i have here, is that when I got a bold tag 
 opend in the first 200 chrs, and it's closed after 400 chrs, then the rest 
 off the page is also bold.

 somebody got a solution ?

 Thanks for reading.

 Mike

 -- 
 Medusa, Media Usage Advice B.V.
 Science Park Eindhoven 5216
 5692 EG SON
 tel: 040-24 57 024  fax: 040-29 63 567
 url: www.medusa.nl
 mail: [EMAIL PROTECTED]

 Uw bedrijf voor Multimedia op Maat 


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



[PHP-DB] Re: weird comparsion

2007-05-04 Thread itoctopus
You have to use the type equality
=== (3 equals), otherwise, what the comparision does it that it will compare 
the value of foo as a number (which is 0) to 0.
Note that there are php functions, such as strpos, who can lead to serious 
flaws in your program if you use the type equality.
strpos returns 0 if the position of the string is 0 in the other string, 
however, it returns FALSE if it is not.

Hope that helps,

-- 
itoctopus - http://www.itoctopus.com
OKi98 [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hello,

 Why does anything compared to 0 return true?

 I know it might seem to be a bit off-topic, but for me it is important for 
 detecting if NULL value in table has been changed (for example NULL is 
 changed to 0).

 if (foo==0) echo(foo equals to 0);

 OKi98 

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