I notice your query says
SELECT x,y,COUNT(y),z FROM ... GROUP BY y
It was my understanding that when using aggregate function, you need to
group by each field in your select-clause, so your query should be:
SELECT x,y,COUNT(y),z FROM ... GROUP BY x, y, z
Hope this helps,
Yves Sucaet
Iowa
What kind of media are you trying to retrieve? Are you trying to retrieve
the MySQL data and stream that through your script to the client? How big is
the BLOB?
If nothing else, you'll need to adapt the MIME-type in the header of your
HTTP-message.
HTH,
Yves
- Original Message -
F
that will retrieve it from
the db as a wav format already. thank you
Yves Sucaet wrote:
What kind of media are you trying to retrieve? Are you trying to retrieve
the MySQL data and stream that through your script to the client? How big
is the BLOB?
If nothing else, you'll need to adapt t
Hi nhadie,
1. Unlike, ASP or ASP.NET, PHP only has a Session object, not an Application
object. A session is only available to one single user only, and you can't
share information between Sessions using PHP (you'd use the Application object
for this in ASP(.NET)). While you can probably hack your
>> 2. This is trickier. What do you mean with "access"? Are you talking about
>> lost updates? Are you talking about simple read-operations? Actually, even
as
>> you claim you're a newbie, you're asking questions that are keeping us all
up
>> at night! :-) The solutions vary depending on your situa
An easier way would be to use the built-in MySQL functions directly. That way,
you avoid issues with date-format conversions between PHP and MySQL.
Look at: http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
You code then becomes:
switch ($type) {
case "today": $sql = "... where
Hi Jason,
It's not because you create a date/time value that you automatically have an
integer-value. You need to specify first that you want the date/time value
converted to an integer value first.
See
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_unix-timestamp
f
Just like to point out http://www.sqlyog.com, an alternative stand-alone
desktop tool to manage you MySQL servers. The free community edition is very
good! I've been using it for 3 years now and never had to need to install
anything else or additional.
HTH,
Yves
select * from table1 inner join table2 on (table1.common1 = table2.common2)
inner join table3 on (table2.common2 = table3.common3)
HTH,
Yves
- Original Message -
From: "Ron Piggott" <[EMAIL PROTECTED]>
To: "PHP DB"
Sent: Saturday, May 10, 2008 4:33 PM
Subject: [PHP-DB] Inner joining
Allow me to point out that this is not database-related...
This website should get you everything you want:
http://www.acmesoffware.com/acme/ExamplesJS/jsExm_ValidateInteger.asp
HTH,
Yves
- Original Message -
From: "arafat uddin" <[EMAIL PROTECTED]>
To:
Sent: Sunday, May 11, 2008 12
ECTED]>:
-
and
this database field data type select int (integer) ,
tinyint, int, bigint... or
if(gettype($_POST['field'])!="integer") // or if(intval($_POST['field'])==0)
or if(!intval($_POST['field']))
{
print"not integer&qu
Hello,
We have several PHP applications that run on the same server. We'd like to
split them up over two servers. Can somebody help me get started to set up a
replicated MySQL installation? I'd like to host the same DB on both machines,
and so when one updates the other should update etc... How
My php.ini is actually in the c:\windows folder. Also: Check to see if you
have multiple versions of php.ini on your system. Maybe you have a version in
c:\php or c:\windows in addition to c:/windows/system32 and the wrong file
gets interpreted.
HTH,
Yves
-- Original Message --
Received:
f php.ini ,i unquoted in all
php.ini file php_mssql.dll extension. i put this dll into system32 folder
.
but still i cant see mssql library in phpinfo() page. i dont understand
why?
is there anything besides above things i should do?
""YVES SUCAET"" <[EMAIL PROTECT
If you want to go for a modular approach, you should consider switching to a
solution such as Smarty: http://www.smarty.net for more info.
HTH,
Yves
-- Original Message --
Received: Sat, 07 Jun 2008 11:55:38 AM CDT
From: "Nitsan Bin-Nun" <[EMAIL PROTECTED]>
To: "Nasreen Laghari" <[EMAIL
It is definitely possible, but I'm not sure if any standard solutions exist.
You could encapsulate your mysql_query() function into a class that has a
Serializable() method. You'd have to write your own method for that though.
Too bad MySQL doesn't support the "select for xml" construction
Hello,
What's the equivalent of mysql_error() and mysql_errno() in MDB2?
When I'm sending an incorrect SQL-statement to the server and it fails, all
I'm getting is "MDB2 Error: syntax error".
Thanks in advance,
Yves Sucaet
Iowa State University
--
PHP Da
> Hello,
>
> What's the equivalent of mysql_error() and mysql_errno() in MDB2?
>
> When I'm sending an incorrect SQL-statement to the server and it fails, all
> I'm getting is "MDB2 Error: syntax error".
>
> Thanks in advance,
>
> Yves Su
Depending on how much data we're talking about, the PHPMyAdmin may not be
the best solution.
Microsoft SQL Server has a DTS (data transformation services) that will
convert anything into anything (as long as *it* has a ODBC or OLEDB driver).
Yves
- Original Message -
From: "santoso
$out = substr($out, 0, strlen($out) - 1);
Removes the overhead cost of creating the array and then joining it.
HTH,
Yves
-- Original Message --
Received: Tue, 12 Aug 2008 02:31:28 PM CDT
From: Micah Gersten <[EMAIL PROTECTED]>
To: "A. Joseph" <[EMAIL PROTECTED]>Cc: php-db@lists.php.net
Original Message --
Received: Tue, 12 Aug 2008 03:08:41 PM CDT
From: "A. Joseph" <[EMAIL PROTECTED]>
To: "YVES SUCAET" <[EMAIL PROTECTED]>
Subject: Re: [PHP-DB] I want to remove the last comma
I tried all this, all i want is something line this
var tinyMC
Well, yes, it is expected behavior. I think you're confusing the abs() with
the round() function (see Evert's answer earlier).
abs(-1.05) = 1.05
round(-1.05) = -1
abs(1.35) = 1.35
round(1.35) = 1
hth,
Yves
- Original Message -
From: "Andrew Martin" <[EMAIL PROTECTED]>
To:
Sent: Thu
Ah, how to debug SQL code in PHP...
Here's what I would do: run your query separately in something like SQLyog or
the Netbeans database interface. Just to "echo $sql" and copy and paste. An
"echo $Record" statement may also help to assure that you're passing on the PK
to the record correctly.
One
Hi List,
What are the equivalent MDB2 methods for:
* mysql_last_insert_id()
* mysql_real_escape_string()
Much obliged,
Yves
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
:29:42 PM CDT
From: "Evert Lammerts" <[EMAIL PROTECTED]>
To: "YVES SUCAET" <[EMAIL PROTECTED]>Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Getting started with MDB2
> * mysql_last_insert_id()
getAfterId()
http://pear.php.net/reference/LiveUs
-- Original Message --
Received: Mon, 08 Sep 2008 02:02:44 PM CDT
From: "Evert Lammerts" <[EMAIL PROTECTED]>
To: "YVES SUCAET" <[EMAIL PROTECTED]>Cc: php-db@lists.php.net,
[EMAIL PROTECTED]
Subject: Re: [PHP-DB] Getting started with MDB2
Have a look at this:
htt
Hi List,
I was wondering what strategies people are using to handle large volumes of XML
data:
How do you store the data? e.g.: Text-files, databases (which one)...?
How big are your datasets? e.g.: MB, GB, TB...?
What do you use to query the data? e.g.: PHP w/ text-files, SQLServer with "for
x
e too tightly coupled).
Ideas, considerations, thoughts, suggestions...?
-- Original Message --
Received: Tue, 09 Sep 2008 10:29:57 AM CDT
From: Lester Caine <[EMAIL PROTECTED]>
To: php-db@LISTS.PHP.NET
Subject: Re: [PHP-DB] databases and XML
Yves Sucaet wrote:
> Hi List,
>
> I w
Do you mean multi level marketing? What kind of matrix calculations? What sort
of data do the matrices include?
And what does this have to do with databases? Do you need to store matrix data
in your db?
-- Original Message --
Received: Tue, 23 Sep 2008 12:29:40 PM CDT
From: "A. Joseph" <[
riginal Message --
Received: Tue, 23 Sep 2008 04:09:30 PM CDT
From: "A. Joseph" <[EMAIL PROTECTED]>
To: "YVES SUCAET" <[EMAIL PROTECTED]>
Subject: Re: [PHP-DB] Matrix programming
LIKE..
remember every child is also parent
parent on level
Why do you need to store the files in a database? Can't you just keep them on
the hard disk and query them with DOM?
-- Original Message --
Received: Tue, 23 Sep 2008 03:55:25 PM CDT
From: ERNESTO PENALOZA <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Subject: [PHP-DB] Insert a xml file in
How could I rewrite the following query so it runs faster:
select distinct location from blockunit where blockid in (
select bu.blockid from blockunit bu inner join interactionparts ip on
(bu.blockid = ip.part)
where ip.blockid in
(110936,110937,111641,111642,113140,113141,114925,114926,12
me help re-writing it with
EXISTS...
Thanks for the help so far,
Yves
- Original Message -
From: Jack van Zanen
To: Chris
Cc: YVES SUCAET ; php-db@lists.php.net
Sent: Thursday, September 25, 2008 7:49 PM
Subject: Re: [PHP-DB] query optimization
If you can answer the other
Oh, sorry I forgot to mention this. It's a MySQL database.
- Original Message -
From: "Micah Gersten" <[EMAIL PROTECTED]>
To: "YVES SUCAET" <[EMAIL PROTECTED]>
Cc:
Sent: Thursday, September 25, 2008 7:55 PM
Subject: Re: [PHP-DB] query optimization
dex per table, so to speed the query, we need to
know what indices you have for the 2 tables.
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
Yves Sucaet wrote:
Oh, sorry I forgot to mention this. It's a MySQL database.
- Original Message
Well, *technicaly*... you could open a socket to the MySQL server and talk to
it, but that's probably a bit much, so...
You never mentioned what kind of server this is. Is this on *nix or Windows?
And do you have access to the php.ini file at least so you can enable the
mysql extension?
Other tha
Hi Twaha,
Have a look at a short-course curriculum that we developed over summer:
http://lab.bcb.iastate.edu/training/webdev/nmsu/
hth,
Yves
- Original Message -
From: "Twaha Uddessy" <[EMAIL PROTECTED]>
To:
Sent: Friday, October 31, 2008 2:19 AM
Subject: [PHP-DB] PHP Exercises
Hello,
Anybody knows how to make PHP connect to Microsoft SQL Server Express 2008?
I know about the php_mssql extension, but that's apparently only the beginning.
What else do I need to do, assuming I have a standard SQLServer setup...
Thanks in advance,
Yves
Just my two cents, but I doubt if Yahoo uses the same implementation of
MySQL as we do. They probably have a tweaked version of it that fits their
needs better than the free public version. Bare in mind too that MySQL *is*
a commercial company, even more so now they've been acquired by Sun.
Th
How does the "default" php_mysql.dll compare to these? Is mysqli faster than
mysql?
tia,
Yves
-- Original Message --
Received: Wed, 19 Nov 2008 04:00:46 PM CST
From: Chris <[EMAIL PROTECTED]>
To: Micah Gersten <[EMAIL PROTECTED]>Cc: PHP DB
Subject: Re: [PHP-DB] PHP MySQL Driver Choice -
Hi Ron,
What's your Javascript client-side code to invoke the PHP-script? You may
need to switch to $_GET[] instead of $_POST...
Yves
- Original Message -
From: "Ron Piggott" <[EMAIL PROTECTED]>
To: "PHP DB"
Sent: Thursday, November 27, 2008 7:02 PM
Subject: [PHP-DB] Value of $_POS
ginal Message --
Received: Thu, 27 Nov 2008 08:48:08 PM CST
From: "Martin, Steve \(MAN-Corporate\)" <[EMAIL PROTECTED]>
To: "Yves Sucaet" <[EMAIL PROTECTED]>,
Subject: RE: [PHP-DB] Value of $_POST['submit']
When I'm developing a number of pages
Hi Ken,
How long does the mysqldump operation last? Maybe it's a script timeout
problem? And maybe you have different settings on both machines?
Other idea: what about pathnames? Linux uses "/" to separate paths, Windows
uses "\".
That's all I have for now,
Yves
- Original Message --
the slashes thing used to trip me up, too, when I first
started working around Linux boxes. However, the file *is* being created
and it is in the right place, just nothing in it.
Ken
On Dec 10, 2008, at 9:43 AM, Yves Sucaet wrote:
Hi Ken,
How long does the mysqldump operation last? Ma
Hi Joseph,
With the sum() aggregate function you'll need to use a GROUP BY clause and
specify which fields you want from e1 and l1. Something like this:
SELECT e1.field1, e1.field2, l1.field3, SUM(a1.adp_amount) as amount
FROM a1 inner join e1 on (a1.loanID = a1.adp_loanID) inner join l1 on
(
l1.field3
hth,
Yves
- Original Message -
From: "Yves Sucaet"
To:
Sent: Tuesday, January 13, 2009 7:49 AM
Subject: Re: [PHP-DB] help me JOIN 3 tables.
Hi Joseph,
With the sum() aggregate function you'll need to use a GROUP BY clause and
specify which field
Your problem is in "SELECT e1.*, l1.*": the selected fields have to match the
ones in the GROUP BY clause, so something like:
SELECT a, b, c, SUM(d) ... GROUP BY a, b, c
hth,
Yves
-- Original Message --
Received: Tue, 13 Jan 2009 09:24:48 AM CST
From: Abah Joseph
To: Y
at I can't find the PECL php_java.dll anywhere. Another project
http://php-java-bridge.sourceforge.net/pjb/ seems to rely on Apache and LAMP
installations all-together, and is therefore not an option for my Windows/IIS
setup.
Has anybody tried something similar and been succesful?
Thanks in a
The professional version of SQLyog (http://www.sqlyog.com) has this
capability. It's not free though.
If you're looking for a free tool, I think the standard out there is
DBDesigner: http://www.fabforce.net/dbdesigner4/
Alternatively, I once wrote a tool that automatically converted a SQL cre
Hi List,
I'm experiencing the problem as described at
http://forums.mysql.com/read.php?37,39779,136287#msg-136287
I'm using the following script to test:
Results are very unpredictable. E.g. out of 120 connection attempts, I'll have
114 successes and 6 failures.
The solution that's mentioned
basic PHP php_mysql.dll driver. I've used MDB2 from PEAR as
well: same result. I think both of these use the C API, and not the
ODBC-driver.
Yves
-- Original Message --
Received: Thu, 12 Mar 2009 04:30:33 PM CDT
From: Chris
To: YVES SUCAET Cc: php-db@lists.php.net
Subject: Re: [PHP-
What if you use back-quotes `` around the table/view name?
$stmt = OCIParse($conn, "SELECT * FROM `v$sql`");
- Original Message -
From:
To: "Mark Casson" ;
Sent: Thursday, April 23, 2009 5:25 AM
Subject: RE: [PHP-DB] PHP and table/view names with '$'
I find that using single quot
on't
want the $ to be interpreted within the double quotes, you should be able to
prevent this by using the backslash \ character.
So, we get:
$name = "Yves";
$name2 = "$name Sucaet";// "Yves Sucaet"
$name3 = '$name Sucaet';// "$name
Switch back to double quotes? :-)
$stmt = OCIParse($conn, "SELECT * FROM v\$sql WHERE
INSTR(SQL_TEXT,'something')>0");
- Original Message -
From: "Mark Casson"
To:
Sent: Thursday, April 23, 2009 6:10 AM
Subject: [PHP-DB] Re: PHP and table/view names with '$'
Hi,
Of course, the
Should be simple enough... Do you have the mysqli driver enabled in your
php.ini file?
;extension=php_mysqli.dll
should become
extension=php_mysqli.dll
hth,
Yves
-- Original Message --
Received: Tue, 28 Apr 2009 06:55:37 PM CDT
From: "Katiyar \(GMail\)"
To: Cc:
Subject: [PHP-DB] How
I agree with using ImageMagick. It works much faster than GD and you'll be
able to manipulate much larger images.
- Original Message -
From: "Phpster"
To: "Emiliano Boragina"
Cc:
Sent: Saturday, July 11, 2009 9:13 AM
Subject: Re: [PHP-DB] resize 10 upload image
On Jul 10, 2009
Hi List,
Am I the only one who's getting the feeling that we're doing Emiliano's JOB
here? Maybe he should try posting a job opening at his company to this list,
instead of letting us solve all his problems and write his entire
application for him.
I'm all for helping each other out, but thi
Why don't you use mysql_fetch_assoc() instead? You can address your fields
directly, as in:
while($row_FOTOS=mysql_fetch_assoc($result))
{
echo "height='384' />";
echo "height='384' />";
}
Alternatively, you can specify which fields you want in your SQL statement:
$sql = "SEL
Hi Ron,
Have a look at http://www.php.net/manual/en/function.mysql-info.php
- Original Message -
From: "Ron Piggott"
To: "PHP DB"
Sent: Monday, November 02, 2009 11:59 PM
Subject: [PHP-DB] PHP Update query
How do I test if an UPDATE query worked
$query = "UPDATE `clients` SET `co
59 matches
Mail list logo