"This is kind of interesting ...
$query="SELECT * FROM quiettimequotation WHERE used = 0 ORDER BY RAND()
LIMIT 1";
works;
$query="SELECT * FROM bibleverses WHERE 'used' = 0 ORDER BY RAND() LIMIT
1";
doesn't! Having the ' around used makes that select command fail ---
but
the UPDATE command req
I have a MyISAM table holding images with field types bigint(20), mediumblob,
varchar(255), blob and tinyint(3). The table has grown to over 800 MB and over
6,000 rows. In the past week, performance has been about 15-20 seconds to run
the following select statement which pulls only 16 maximum
I meant
'Analyze table'
and
'the composite key "field2 field3" would be unique'
- Original Message -
From: "Dwight Altman" <[EMAIL PROTECTED]>
To:
Sent: Wednesday, August 10, 2005 4:23 PM
Subject: [PHP-DB] SELECT Performance and INDEXi
be unique'
>
> ----- Original Message -
> From: "Dwight Altman" <[EMAIL PROTECTED]>
> To:
> Sent: Wednesday, August 10, 2005 4:23 PM
> Subject: [PHP-DB] SELECT Performance and INDEXing
>
>
> I have a MyISAM table holding images with field types
LAIN on the first statement and post the results?
-Micah
On Thursday 18 August 2005 1:02 pm, Dwight Altman wrote:
Hey, this is my first question. So if you could just reply to say it
reached the php-db list, that would be terrific. Of course, answering
the
questions would be awesome as well.
&g
but I'd be curious if it affects the
outcome)
Also, add an index on field1 and field2 if you don't already, as that may
help. (sometimes it doesn't, depending on data type)
I hope that helps,
-Micah
On Thursday 18 August 2005 4:30 pm, Dwight Altman wrote:
Thanks for your reply.
I suppose you could use "count( PDOStatement::fetchAll() )", but I
understand your amazement.
mysql_num_rows() is specific to MySQL. He wants a PDO version.
-Original Message-
From: Micah Stevens [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 08, 2005 10:51 AM
To: php-db@lists.php.net
Hello List,
Is there an IS_NUMERIC(aCandidateString) function in MySQL that I can run in
a query, similar to the various PHP "is_*" functions? I can't seem to find
it in the docs (other than a C API IS_NUM macro).
I have a field in a database with serial numbers like:
...1234
...1235
...1236-A
..
TECTED]
>
> http://php.belnet.be/manual/en/function.is-numeric.php
>
> Apparently there is :)
>
>
> Dwight Altman wrote:
> > Hello List,
> > Is there an IS_NUMERIC(aCandidateString) function in MySQL that I
can run in
> > a query, similar to the various PHP "is
Did you actually SNIP the "document[ation] how it can be done safely for all
the world to see and learn!" ??? Or are you saying go buy this book?
-Original Message-
From: Peter Beckman [mailto:[EMAIL PROTECTED]
Sent: Friday, January 06, 2006 10:54 PM
To: Neil Smith [MVP, Digital media]
C
>Did you actually SNIP the "document[ation] how it can be done safely for
all
>the world to see and learn!" ??? Or are you saying go buy this book?
No, I retyped the passage in its entirety from the book. Learn to
SNIP your posts !
Cheers - Neil
--
Neil,
Perhaps you replied directly to the
>Neil,
>Perhaps you replied directly to the thread starter.
My bad. It was in Friday's batch or emails.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I didn't read all your code, but this jumped out to me also as to Bastien
for ( $i = 1; $i < count($array); $i++ ) {
If you have 1 file, then you probably have "1 < 1" which does not execute
even once. I definitely suggest also "$i = 0;...".
-Dwight
-Original Message-
From: Chris Payne
Put nl2br() around the field in the table that you saved newlines
nl2br($row['theTableFieldWithTheNewlines'])
maybe
' . nl2br($row['task_usaction']) . '
-Original Message-
From: Jeff Broomall [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 01, 2006 10:34 AM
To: Jeff Broomall
Cc: php-db@
Like array(), this is not really a function, but a language construct.
list() is used to assign a list of variables in one operation.
http://php.he.net/manual/en/function.list.php
Watch out for those "language constructs" which look to us like functions.
Probably related to some folks preferring
If you POST from your form use $_POST, or $_GET for a form GET
foreach($_POST as $key => $value){
if( strpos($value, $findme) !== false ){
//$findme was found in $value
}
}
http://php.net/manual/en/reserved.variables.php
http://us2.php.net/manual/en/control-structu
>>Sure, mysql.com and seasrch for crypt. Not sure why this is asked on a
>>PHP list since it has nothing to do with PHP.
> b) every language has a crypt function
Then I guess it's okay to have crypt questions/answers on "every language"
list.
-Original Message-
From: JupiterHost.Net [ma
Incorporating what Bastien said:
$badWordsArray = array("these" ,"are", "bad", "words");
foreach($_POST as $key => $value){
if( in_array($value, $badWordsArray) ){
//$value was found in $badWordsArray
}
}
http://us2.php.net/in_array
-Original Message-
From
How about posting your solution as well? Maybe someone will find it useful.
-Original Message-
From: Rob W. [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 14, 2006 2:07 AM
To: php-db@lists.php.net
Subject: Re: [PHP-DB] Text file (rw) question...
Nevermind. I figured it out.
- Orig
How about:
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result)) {
instead of your line 6 and 7?
And why are you going back to db_query on line 9 instead of staying with
mysql_query?
Also, you might want to check $num_rows = mysql_num_rows($result);
instead of
line 10 $has_tipp
Could it be related to quality in JPEG lossy compression? Can you try PNG
instead?
-Original Message-
From: nikos [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 27, 2006 11:28 AM
To: PHP-mailist (PHP-mailist)
Subject: [PHP-DB] Bad picture colors
Hello list
I use the following code to
ay" pngs Dwight
Thnak you
_
Γατσής Νίκος - Gatsis Nikos
Web developer
tel.: 2108256721 - 2108256722
fax: 2108256712
email: [EMAIL PROTECTED]
http://www.qbit.gr
-Original Message-
From: Dwight Altman [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 27, 2006 7:41 PM
To: '
" Right after rebuilding php and apache and breaking PHP funtionality for
everyone, just so you can send a semi complex MIME message? That is the
epitome of PHP's lameness and why I can't sit quietly by and not
recommend an easy to install and use and maintain solution."
This command breaks Apa
I use $_SERVER['REMOTE_ADDR'], but the notes at http://us2.php.net/getenv
say you may want to also use HTTP_X_FORWARDED_FOR (and not even getenv but
$_SERVER as you were attempting).
Regards,
Dwight
> -Original Message-
> From: Oliver Block [mailto:[EMAIL PROTECTED]
> Sent: Friday, June
I believe I did this one time without changing the database schema; simply
by just putting the type in the ORDER BY clause.
Something like
ORDER BY BINARY numbers ASC
or maybe
ORDER BY CAST(numbers AS BINARY) ASC
Regards,
Dwight
> -Original Message-
> From: J. Alejandro Ceballos Z. -JOAL
I use:
$sql .= "`first_name` = '" . $first_name . "', ";
in the if statements. Notice the angled tick marks and single tick marks.
Then before executing the query, remove the last ", ".
$sql = substr($sql, 0, -2);
In your case, before you append the WHERE clause.
You should echo out your built-u
Is there a way to get the number of rows that would have been returned had
there not been a LIMIT clause in a SELECT statement?
For example, if
Query #1) SELECT * FROM aTable
would normally return 100 rows. But
Query #2) SELECT * FROM aTable LIMIT 5
will return 5 rows. Is there a way to find out
en though there was a LIMIT clause]. Something
like mysql_info.
Regards,
Dwight
x2407
> -Original Message-
> From: Frank M. Kromann [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 29, 2006 5:46 PM
> To: Dwight Altman
> Cc: php-db@lists.php.net
> Subject: Re: [PHP-DB] LI
CALC_FOUND_ROWS solution was still a bit faster.
Perhaps it varies by table structure? Either way, it might be worth checking
which is faster for your application.
Regards,
Dwight
> -Original Message-----
> From: Dwight Altman [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 05, 20
f you're using MySQL then:
>
> SELECT SQL_CALC_FOUND_ROWS * FROM aTable LIMIT 5
> SELECT FOUND_ROWS()
>
> It's in the mysql documentation under SELECT syntax I believe.
>
> Chris
>
> Dwight Altman wrote:
> > Is there a way to get the number of rows that would
If you can make Access execute a shell function, maybe you can use cURL or
wget to signal a web PHP script to run (and/or run the PHP program -- if it
is not accessible through a URL).
Regards,
Dwight
> -Original Message-
> From: bill [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 07, 200
I don't think so, because the OP needs other form fields submitted as well.
Regards,
Dwight
> -Original Message-
> From: Sean Mumford [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 17, 2006 9:24 AM
> To: 'Php-Db'
> Subject: RE: [PHP-DB] Submitting form from
> Couldn't you achieve the sa
substr
Regards,
Dwight
> -Original Message-
> From: Benjamin Adams [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 18, 2006 12:25 PM
> To: PHP DB
> Subject: [PHP-DB] Only a section from the database result
>
> I have articles in a MySQL database and I want creating a fast brows
> where p
echo "" . substr($row['pagetext'], 0, 50) . "";
Regards,
Dwight
> -Original Message-
> From: Benjamin Adams [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 18, 2006 12:25 PM
> To: PHP DB
> Subject: [PHP-DB] Only a section from the database result
>
> I have articles in a MySQL database a
Check your version. Subselects were only added in MySQL Version 4.1.
Regards,
Dwight
> -Original Message-
> From: Edwin Cruz [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 28, 2006 10:53 AM
> To: 'Miguel Guirao'; php-db@lists.php.net
> Subject: RE: [PHP-DB] SQL query
>
> Make sur
You have
while($row=pg_fetch_array($result,NULL,PGSQL_ASSOC)) {
What's with the NULL ?
row
Row number in result to fetch. Rows are numbered from 0 upwards. If
omitted, next row is fetched.
BUT you are requesting the NULL row?
Why not just use
while($row=pg_fetch_assoc($result)) {
Regards,
Assuming $submit even has a value (Are you sure you don't mean
$_POST['something'] here?) all your code does is test 2 variables, connect
to the server, change to a database and set some more few variables. When
do you plan to execute a query "mysql_query($sql)", or output a print or
echo of some
So we are talking about MS Windows?
I was shocked to see Linux antivirus offerings, so you had me concerned for
a moment.
I can only laugh at your calamity.
Okay, I can offer something else. How about providing the list with the
"not found in..." part? Perhaps put it where it is looking for it
Typo?
$_SERVER['|PHP_AUTH_USER'] != $_SERVER['PHP_AUTH_USER']
Notice the pipe "|" before "PHP_AUTH_USER"?
Regards,
Dwight
> -Original Message-
> From: Mike van Hoof [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 06, 2007 2:03 AM
> To: php-db@lists.php.net
> Subject: [PHP-DB] PHP_AUTH_U
Is there any way to get "" at "mockandmore.de" unsubscribed?
I sent to php-db@lists.php.net which is not moderated.
Regards,
Dwight
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 06, 2007 10:04 AM
To: was_my_email_address
Subject: Unbekannter E
Is there an existing way via a function or variable to determine Apache
mod_auth_mysql directives (specifically AuthMySQLDB) in use for the current
script?
On our servers, some directories use a basic .htaccess file while some use a
database under mod_auth_mysql while the latest user management sy
LDB entry.
Regards,
Dwight
> -Original Message-
> From: Chris [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, April 18, 2007 7:28 PM
> To: Dwight Altman
> Cc: php-db@lists.php.net
> Subject: Re: [PHP-DB] Determine AuthMySQL* directives in script?
>
> Dwight Altman wrote:
Sent: Thursday, April 19, 2007 7:20 PM
> To: Dwight Altman
> Cc: php-db@lists.php.net
> Subject: Re: [PHP-DB] Determine AuthMySQL* directives in script?
>
> Dwight Altman wrote:
> > I only agree to it "depending" if I have to write my own function using
> a
> >
Regards,
Dwight
> -Original Message-
> From: Dwight Altman [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 20, 2007 9:32 AM
> To: php-db@lists.php.net
> Subject: RE: [PHP-DB] Determine AuthMySQL* directives in script?
>
> Cool alternative.
>
> We don
http://php.he.net/manual/en/function.pcntl-fork.php says 'The reason for the
MySQL "Lost Connection during query"...' like what you concluded, although
they grab a new $db connection in the first for loop
"} else if ( $pid ) {" I bet a child closes the one you create after the for
loop while the pa
Actually I suppose you need to loop with foreach to wait on all children
before attempting any $db->execute, then after your foreach loop, get your
$db and execute.
Regards,
Dwight
> -Original Message-
> From: Dwight Altman [mailto:[EMAIL PROTECTED]
> Sent: Monday, April 23
EMAIL PROTECTED]
> Sent: Monday, April 23, 2007 12:01 PM
> To: Dwight Altman; php-db@lists.php.net
> Subject: Re: [PHP-DB] Forking and database connections
>
> Hey Dwight,
>
> Thanks for the replies! When the first child thread closes, all of the DB
> connections seem to cl
To use a PEAR::DB persistent connection, try
$db = DB::connect($dsn, TRUE);
or
$db = DB::connect($dsn, true);
Googled for "pear::db persistent connection" and got
http://vulcanonet.com/soft/?pack=pear_tut
Regards,
Dwight
> -Original Message-
> From: Dwight Altma
Glad to help.
I was actually interested in your post because of forking versus threading.
I still haven't found anything except for PHP-GTK but it may help your
database related performance if it is added/exists in PHP.
Regards,
Dwight
> -Original Message-
> From: Chris Verges [mailto:[EM
Businesses
--
id
businessName
isChristianBookstore
isGift
isHomeDecor
isSkinCareAndCosmetics
isThriftStore
CREATE TABLE `Businesses` (
`id` BIGINT NOT NULL AUTO_INCREMENT ,
`businessName` VARCHAR( 64 ) NOT NULL ,
`isChristianBookstore` TINYINT( 1 ) NOT NULL ,
`isGift` TINYINT( 1 ) NOT NUL
In case echo mysql_error(); gives you exactly what the browser gave you,
what you need to be doing is echo'ing your SQL statement and checking if
that statement is correct.
Try your SQL statement in a query tool like phpmyadmin, but that still may
say your syntax is wrong.
Regards,
Dwight
> -
That's one of the uses of Ajax.
http://www.xajaxproject.org/
http://wiki.xajaxproject.org/Tutorials:Learn_xajax_in_10_Minutes
You don't "have to use an iframe".
Regards,
Dwight
> -Original Message-
> From: Todd A. Dorschner [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 11, 2007 8:31 AM
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
> 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]
> &g
On Jul 12, 2007, at 9:50 PM, Austin C wrote:
Hello, I dont get any errors. Just a blank page. But, I go to the
database,
and it did what I told it to with the header table, but not with the
circulation table.
Check your error log or add this as the first line in your script.
ini_set('displa
On Jul 12, 2007, at 9:50 PM, Austin C wrote:
Hello, I dont get any errors. Just a blank page. But, I go to the
database,
and it did what I told it to with the header table, but not with the
circulation table.
After you built the SQL for the circulation table, you did not
execute it [with
56 matches
Mail list logo