Re: [PHP-DB] RE: Search results

2002-02-06 Thread Chris Boget
You can use mysql_result_rows() to check whether any rows were returned; something like: you mean: mysql_num_rows(); ? Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] if variable is equal to 2 through 4

2002-02-06 Thread Chris Boget
how would I write it if I wanted to say this: if $variable == 2 through 4 ??? if(( $variable = 2 ) ( $variable = 4 )) { echo Equals 2 through 4br\n; } Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] PHP/Apache on Unix and MS SQLServer on NT

2002-05-17 Thread Chris Boget
Does anyone have experience with this environment? Pros? Cons? Any latency problems? Connectivity issues? I'd be very interested in hearing your experiences with this. What do you like about it? What don't you? Would you set your platform up like this if you could go back and do it again?

[PHP-DB] Re: [PHP-WIN] RE: [PHP] How to Show my Own Error Message Instead of Mysql Error?

2002-06-21 Thread Chris Boget
i made a Registration Form for user to input their Data, but i also had some Field Check before the data can be insert to the Mysql_Database! I had a question here, sometime the mysql shows the error : Duplicate Key for xxx I know what is this about, reguarding to my Registration Form, it

Re: [PHP-DB] BBS program

2002-06-21 Thread Chris Boget
I would like to avoid reinventing the wheel and find an existing BBS program. Do these exist? You could probably take a look at PHPNuke or something along those lines. Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] BBS program

2002-06-21 Thread Chris Boget
BBS = Backyard Bible Study? Heh. Good guess. BBS = Bulliten Board System. Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] PDF

2002-07-08 Thread Chris Boget
If someone has any idea, please let me know I would strongly suggest that you use a PDF class of some sort. There're quite a few available. I've had good results with pc4p. Typically, most PDF classes require that it be working from some sort of static template. If that is fine, then

Re: [PHP-DB] convert 2 dates to number of hours

2002-09-30 Thread Chris Boget
Hello, how can i calculate the number of hours between 2 dates, ( $unixDateTimeTo - $unixDateTimeFrom ) * 60 * 60 and better yet , the work hours ( example from 8.30am to 6pm excluding weekends) This would be more involved. Are you trying to find out how many work hours there were between

Re: [PHP-DB] [Newbie Q] csv file upload via php to mysql tutoria

2002-11-07 Thread Chris Boget
Is Load-Data possible in mssql? I'm unsure but the original poster was asking about mysql. Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] preventing page from resubmitting when refreshing page

2003-01-09 Thread Chris Boget
Is there something i can do on browser refresh to prevent this or prevent my mysql database from duplicating the records? Instead of using INSERT in your query use REPLACE INTO. Alternately, after you are done processing the form, do this: header( location: $PHP_SELF?$QUERY_STRING ); exit()

Re: [PHP-DB] If select query doesn't net any results

2003-01-09 Thread Chris Boget
I would like to created an if statement that only occurs if the query gets a result. If there are no records that meet the query conditionals and my array ends up with null, I do not want my if statement to take place. Is this easy enough to do? Any help would be great. if(

Re: [PHP-DB] which DBMS... MySQL or PostgreSQL

2003-01-09 Thread Chris Boget
Hmm.. so it means that I should choose PG ??? That's not something we can answer as it very much depends on your needs. Look at the features that PG has v. the features that MySQL has and decide based on that. If you don't need the functionality PG offers that MySQL doesn't, go with MySQL as

Re: [PHP-DB] Storing IP into DB

2003-01-30 Thread Chris Boget
Make your 'ip' column UNIQUE in your table and ignore errors. Or, set a flag in a session or cookie when you save the IP and if that flag is present on other pages, then don't save the IP. Or I believe you can use REPLACE INTO... Chris -- PHP Database Mailing List (http://www.php.net/) To

Re: [PHP-DB] Preserving form field values between pages/tags

2003-02-18 Thread Chris Boget
Does anyone have a more practical/useful way of preserving field values from page-to-page... or hiding fields as a user clicks on each tag? You can make it all one very, very large form and use DHTML to show or hide the appropriate fields. Chris -- PHP Database Mailing List

Re: [PHP-DB] Storing an array in the database

2003-02-28 Thread Chris Boget
How would I store an array in the database? I want to store 2 things. One array of shirt sizes and one array of which holds other arrays. Easy. script language=php $singleDimArray = array( 1, 2, 3, 4, 5 ); $multiDimArray = array( array( this = that, here = there ),

Re: [PHP-DB] Storing an array in the database

2003-02-28 Thread Chris Boget
FYI: Make sure you addslashes() _after_ you serialize your array if it can contain quotes. Everything else remains the same. Yeah, my bad. Good catch. Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Determining if checkbox is selected in PHP

2003-09-09 Thread Chris Boget
I'm storing the values from a groups of checkboxes in an array keyword[], but $_POST['keyword'] is undefined if none of the checkboxes is checked. The fact that it is undefined if none of the checkboxes are checked is expected behavior. Just do: if( isset( $_POST['keyword'] ) { } to

Re: [PHP-DB] pass by reference

2003-10-09 Thread Chris Boget
How do you pass by reference? I tried $var = myFunction($var1, $var2); but it gave me a warning saying that pass by reference is depreciated function myFunction( $var1, $var2 ) { } You now have to do it in the function definition, not the function call. Chris -- PHP Database Mailing List

Re: [PHP-DB] Using two colomns of mysql data as key/value pairs in arrays

2003-10-20 Thread Chris Boget
mysql_fetch_array( $result ) Actually, for an associative array (which the OP had made reference to), you use mysql_fetch_assoc(). I avoid mysql_fetch_array() like the plague unless there is a very specific need. Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP-DB] Using two colomns of mysql data as key/value pairs in arrays

2003-10-20 Thread Chris Boget
Curious as to why you say you avoid mysql_fetch_array() like the plague. I use it frequently and am wondering if there is something wrong/not secure when using it or if there is a huge amount of overhead associated with its use. It's not that it's not secure, just that it's bad to use any

Re: [PHP-DB] Using two colomns of mysql data as key/value pairs in arrays

2003-10-20 Thread Chris Boget
The original poster actually mentioned an associative array with one db field as the index and another as the value. None of these, just like Ignatius's suggestion, will do the job. Actually, mysql_fetch_assoc() will do quite nicely. I didn't think it worth shooting down someone who was

Re: [PHP-DB] Using two colomns of mysql data as key/value pairs in arrays

2003-10-20 Thread Chris Boget
% The original poster actually mentioned an associative array with one % field as the index and another as the value. None of these, just % Ignatius's suggestion, will do the job. % Actually, mysql_fetch_assoc() will do quite nicely. Really? How? I must be quite confused. No,

Re: [PHP-DB] Using two colomns of mysql data as key/value pairs in arrays

2003-10-20 Thread Chris Boget
result set. Chris, you've made a believer out of me; I'll start using mysql_fetch_assoc() for these kinds of queries from now on. :p And in the spirit of only retrieving what you need from the database, I would agree that mysql_fetch_assoc() is the better option. However, other than maybe

Re: [PHP-DB] Using two colomns of mysql data as key/value pairs in arrays

2003-10-20 Thread Chris Boget
From: Chris Boget [EMAIL PROTECTED] My bad. If MySQL had crosstab functionality, that *might* be able to help. A crosstab is just a specifically formatted query, of which MySQL is certainly capable of handling. I've done them in the past, but maybe you're thinking of something more complex

[PHP-DB] Re: crosstab (was Re: [PHP-DB] Using two colomns ...)

2003-10-20 Thread Chris Boget
% Then I'm not calling it the right thing... just the name of the type % of query that was told. The kind of query I'm talking about is the % one that rotates the result set from tall to wide. Basically doing % exactly what the OP had asked for. If Hmmm... You mean like taking results

Re: [PHP-DB] using code for multiple sites

2003-11-13 Thread Chris Boget
create a directory called inc in /usr/local/apache and then add the following line to php.ini include_path = .:/usr/local/apache/inc I'd use a method like this, although I'd probably just use an absolute path instead of adjusting the include_path. What's the benefit of using an absolute

Re: [PHP-DB] convert date in german format

2003-11-26 Thread Chris Boget
That's because date() wants a Unix timestamp. MySQL has it's own format. You have two options. Option 1 is to use DATE_FORMAT() in your query to retrieve the date already formated. DATE_FORMAT() works similar to the PHP date() function. Look it up in Chapter 6 of the MySQL Manual. Option 2 is

Re: [PHP-DB] breaking apart data

2004-01-20 Thread Chris Boget
duh (me) okay... I am wanting to wrap the lines of text in bullets and perform some text formatting on it (highlight, bold, underling, etc..) using css classes script language=php function bulletElements( $arrElement, $key ) { echo 'li' . $arrElement . '/li'; } $str = asdf

Re: [PHP-DB] breaking apart data

2004-01-21 Thread Chris Boget
Thanks Chris... that worked great. No worries. Guess I need to spend a _lot_ more time reading the manual. It also helps alot just lurking on the list (this and/or PHP general). I've been coding with PHP for almost 6 years and there're still new things I learn all the time. Chris -- PHP

Re: [PHP-DB] Re: PHP OO Problem

2004-04-15 Thread Chris Boget
Is there any way to destroy the object in PHP? http://us2.php.net/manual/en/function.unset.php Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Image / file uploader

2004-04-30 Thread Chris Boget
Thanks Hans. I tried what your suggested and still no luck. What does the actual HTML form look like? Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php