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
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
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
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
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
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
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:
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
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
% 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,
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
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
% 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
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
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
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 ),
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
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
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
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()
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(
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
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
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
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
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
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
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
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?
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
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
31 matches
Mail list logo