I have a question,
I have this SQL statement,
$sql_stmt = "SELECT DISTINCT EXTRACT(YEAR_MONTH FROM visitdate) AS
availYearMonth FROM visitedurl;";
$result = mysql_query ($sql_stmt);
while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) {
echo $row["availYearMonth"];
}
By right the value that
G'day all,
I have some data from Filemaker Pro which needs to have a lot of
search/replacing done before importing into MySQL. I have used ereg_replace
in PHP and end up with a variable holding the correct data. (there are
several hundred rows of data in the variable)
Is it possible to use Load d
Roger Spears wrote:
I've been working on this all day. I'm trying to insert some text
($essay) into a CLOB field (essay) in my table (clob_test).
Can someone please tell me why the following PHP code returns ORA-01036:
illegal variable name/number? Better yet, please tell me how to fix it??
$
Chris wrote:
You can put together WHERE statements with an AND or
an OR. For
instance, "SELECT id FROM users WHERE id='2' OR
id='3'"
You know, if you had a few suspicions about this sort
of thing you
could
always give it a spin in a Query. Worst case scenario
is you will get
an error.
-
Edward, et al --
...and then Becoming Digital said...
%
...
% I'm asking all of you to join me in Operation "Send Captain on the Cruise." All it
takes is a few minutes to PayPal a contribution to [EMAIL PROTECTED] Donations of any
size are welcome, and every little bit helps. If enough of us
On Mon, 2003-10-20 at 15:54, Larry E.Ullman wrote:
> >> To make a donation, simply login to PayPal and click the "Send Money"
> >> tab at the top of your screen. Once there, put
> >> [EMAIL PROTECTED] in the "Recipient's Email" field and fill
> >> out the remaining fields to your liking. :)
>
Sorry for resending the same question. Actually,
I sent the following message a few days before.
However, it seems that no one has the experience
on LDAP. It's a headache for me. Hope this time
some experts can take a look at the question.
I appreciate your kind helps!
*
Donations are by no means required. I just thought it time to really show John how
much we appreciate his help.
I'm not sure how I could do so, but I wish I had the ability to require donations from
mailing list folk. That would be so cool!
Edward Dudlik
"Those who say it cannot be done
shoul
% 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
1 a
2
To make a donation, simply login to PayPal and click the "Send Money"
tab at the top of your screen. Once there, put
[EMAIL PROTECTED] in the "Recipient's Email" field and fill
out the remaining fields to your liking. :)
Even though this thread is much more PHP-related than many of the
topics
>> ORA-01036: illegal variable name/number
Make sure that the variable being bound is in the sql statement.
--
Jon Kriek
http://phpfreaks.com
"Roger Spears" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> I've been working on this all day. I'm trying to insert some tex
Thanks for the kinds words. I'm glad this has been well received (so far).
To make a donation, simply login to PayPal and click the "Send Money" tab at the top
of your screen. Once there, put [EMAIL PROTECTED] in the "Recipient's Email" field
and fill out the remaining fields to your liking. :
Jay Blanchard wrote:
[snip]
PayPal a contribution to [EMAIL PROTECTED]
[/snip]
Fabulous idea Ed, I wish I'd a thunk it for me. At the risk of seeming
ignorant (same risk I run each day by just getting out of bed) how
exactly do I "PayPal a contribution to [EMAIL PROTECTED]"? I have
made Paypal cont
Hello,
I've been working on this all day. I'm trying to insert some text
($essay) into a CLOB field (essay) in my table (clob_test).
Can someone please tell me why the following PHP code returns ORA-01036:
illegal variable name/number? Better yet, please tell me how to fix it??
$DB_Resource =
Becoming Digital wrote:
Anyone who's been on these lists for a few days is already familiar with CPT John W. Holmes. He's probably helped each and every one of us more times than we can count, all without asking for a thing. I think it's time we help him with something.
php|cruise is coming this
[snip]
PayPal a contribution to [EMAIL PROTECTED]
[/snip]
Fabulous idea Ed, I wish I'd a thunk it for me. At the risk of seeming
ignorant (same risk I run each day by just getting out of bed) how
exactly do I "PayPal a contribution to [EMAIL PROTECTED]"? I have
made Paypal contributions before, bu
Anyone who's been on these lists for a few days is already familiar with CPT John W.
Holmes. He's probably helped each and every one of us more times than we can count,
all without asking for a thing. I think it's time we help him with something.
php|cruise is coming this March. As of now, Jo
if(count($data) > 0)
{
//out rows
}
pete
Karen Resplendo wrote:
In VBscript an empty recordset returns the "End of File" marker:
If rs.EOF Then do nothing
How can I do this in PHP using MS SQL Server and ODBC drivers? Here is a peace of my code:
$data= odbc_do($connectionSDWIS,"SEL
Try this, I am assuming that emailerror is one of the fields in your
database.
$thisstart=$massmail[current]-1;
[EMAIL PROTECTED]("select
first_name,last_name,email,".$mysql_prefix."users.username
from ".$mysql_prefix."users $leftjoinfirst $leftjoinsecond
limit $thisstart,$massmail[stop]
where v
> Mysql_fetch_assoc() is faster -- use it. I've learned something.
Using your script and postgres, with PGSQL_ASSOC in fetch_array:
fetch_assoc(): 1.62810707092 seconds [18880 rows](105580.0.52192900 :
105578.89)
fetch_array(): 1.54432892799 seconds [18880 rows](105582.0.06938900 :
Mayo, Chuck wrote:
Hi all,
Hope you'll forgive the duplicate post but the list seems to be hopping
today (unlike the friday afternoon I sent the original query)... since
everyone seems to be awake today I thought I'd try it again:
Sorry about that; I hate to keep my employers waiting. BTW, I have
Hi all,
Hope you'll forgive the duplicate post but the list seems to be hopping
today (unlike the friday afternoon I sent the original query)... since
everyone seems to be awake today I thought I'd try it again:
---
I'm working through an issue that I'm sure everyone else has al
In VBscript an empty recordset returns the "End of File" marker:
If rs.EOF Then do nothing
How can I do this in PHP using MS SQL Server and ODBC drivers? Here is a peace of my
code:
$data= odbc_do($connectionSDWIS,"SELECT LabUserName, LabName, WhichProcess FROM
LabLogin WHERE LabUserName='
From: "David T-G" <[EMAIL PROTECTED]>
> Hmmm... I suppose so, but I can't picture it. Shouldn't you always know
> the DB schema and format of what you're going to get back? I can see not
> knowing how many RECORDS you'll get back but I should think you would
> know how many FIELDS will be in ea
From: "Chris Boget" <[EMAIL PROTECTED]>
> > 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
Aways keep in mind a DBC or free table directory whenever building
references to access data.
- Original Message -
From: "Robert Twitty" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 17, 2003 6:33 PM
Subject: Re: [PHP-DB] ODBTP - ODBC - FOXPRO.
> Setting SourceDB=c:\
> % 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 resul
John, et al --
...and then CPT John W. Holmes said...
%
% From: "David T-G" <[EMAIL PROTECTED]>
%
% > can't think of a practical example for which I would loop over $row...
% > Care to help me out?]
%
% How about a dynamic query where you do not know the number of columns
Hmmm... I suppose so
From: "David T-G" <[EMAIL PROTECTED]>
> [Actually, maybe I'm just too new at this, but I
> can't think of a practical example for which I would loop over $row...
> Care to help me out?]
How about a dynamic query where you do not know the number of columns
that'll be returned? You would not want t
Chris, et al --
...and then Chris Boget said...
%
[quoting Cpt John Holmes]
% > From: "Chris Boget" <[EMAIL PROTECTED]>
% > > 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 hand
> 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
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Jon, et al --
...and then Jon Kriek said...
%
% Perhaps if you would stop sending your posts at attachments ;)
Oh, that. I blame your mail mangler still, but this message has been
folded, spindled, and mutilated just for you :-)
HAND
:-D
- --
D
Chris, et al --
...and then Chris Boget said...
%
...
% > than maybe making my script run a little more slowly, I fail to see how
% > mysql_fetch_array() is a bad thing. From what I can see, all it does is give
% > me an additional numerically indexed reference to the data in my result set
...
%
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 compl
Perhaps if you would stop sending your posts at attachments ;)
>> Dude, your quoting *really* needs some help
--
Jon Kriek
http://phpfreaks.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Devon --
...and then Devon said...
%
% David T-G wrote:
%
% >Note that I don't recommend this as the best approach, and I don't think
...
% >doing it in two steps of loading your $everyone and then spitting out I'd
% >probably do something like
% >
% > $sql = "select id,name from a_table order
Chris, et al --
...and then Chris Boget said...
%
% > % Actually, mysql_fetch_assoc() will do quite nicely.
% > Really? How? I must be quite confused.
%
% No, actually, I am the one who's confused. I misread the OP's email such
% that *_assoc() would do the job.
*whew* Glad to hear that --
Jon, et al --
...and then Jon Kriek said...
%
% Trust me, I was not "shooting anyone down", I would rather quit programming
% then do that - seriously.
Fair enough, and truce declared. Now to simply discuss the finer points
of mysql_fetch_* :-)
%
% --
% Jon Kriek
% http://phpfreaks.com
HA
David T-G wrote:
Note that I don't recommend this as the best approach, and I don't think
that anyone else does, either. Usually you want to avoid sucking an
entire database into your script's memory; the database (and its coders)
almost always handles data better than we mere mortals. A much be
Jon --
...and then Jon Kriek said...
%
% Easier is not always "right" or "good script-logic"
Admitted. I just want to know why it's wrong or so-very-not-good.
%
% Would it be easier for you to type:
%
% mysql_fetch_array($result, MYSQL_ASSOC) {
If I needed to care about the space used by a
Cpt John W. Holmes wrote:
while($r = mysql_fetch_assoc($result))
{ $array[$r['id']] = $r['name']; }
---John Holmes...
Wonderful! Thats exactly what I was looking for! I ended up taking the
array out of the equation entirly as suggested by Davic T-G, but the
simplicity of your answer was exactly
> foreach(); list(); each();
> None are good ideas when iterating through an array generated
> by *_array().
> And I'd hazard to guess that one of the most significant uses
> of any query is
> to iterate through it's result set.
Yeah, OK, I can see how having the extra numerically indexed data w
30% increase is more than I was expecting, but nonetheless I was correct.
--
Jon Kriek
http://phpfreaks.com
"Peter Beckman" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Mysql_fetch_assoc() is faster -- use it.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscri
> 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
Easy, old boys.
Nobody has "holed" or meant to hole anybody.
Let's keep this ML what it is, that is a great learning and working
instrument.
Ignatius
_
- Original Message -
From: "Jon Kriek" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 20, 2003
On Mon, 20 Oct 2003, Jon Kriek wrote:
> Easier is not always "right" or "good script-logic"
>
> Would it be easier for you to type:
>
> mysql_fetch_array($result, MYSQL_ASSOC) {
OK, can we clear this up once and for all?
mysql_fetch_assoc(): 3.7182140350342 seconds [18880 rows]
mysql_fetch_
OK, I used the code Chris provided in his response below and ran it against
the test table below.
mysql> select * from userinfo;
+---+---++---+--
+
| Cust_username | Cust_password | Cust_firstname | Cust_lastname |
Cust_comment |
+---
That is your personal opinion to which you are entitled to, but again
"shooting someone down" is just not the case in this situation.
>> No, but IMNSHO he shot a rather rude hole in Ignatius.
"David T-G" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
--
PHP Database Mailing List (
> % > 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,
Trust me, I was not "shooting anyone down", I would rather quit programming
then do that - seriously.
--
Jon Kriek
http://phpfreaks.com
"David T-G" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.
Chris --
...and then Chris Boget said...
%
% > 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.
Chris Boget wrote:
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.
Im afraid not. I already tried that. It u
Easier is not always "right" or "good script-logic"
Would it be easier for you to type:
mysql_fetch_array($result, MYSQL_ASSOC) {
>> It's easier for me to just always use mysql_fetch_array instead of
figuring out whether I want mysql_fetch_row, mysql_fetch_assoc, or both.
"David T-G" <[EMAIL PRO
Chris, et al --
...and then Chris Boget said...
%
% Actually, for an associative array (which the OP had made reference
% to), you use mysql_fetch_assoc().
See my response to Jon. No single function of which I know is going to
pull what he requested out of the database in the format he desires.
> 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 wa
(1) additional overhead
(2) bad script-logic
--
Jon Kriek
http://phpfreaks.com
"Richard Hutchins" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Chris (Jon Kriek too, I guess),
>
> Curious as to why you say you avoid mysql_fetch_array() like the plague. I
> use it frequently and a
> 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
Jon, et al --
...and then Jon Kriek said...
%
% Ignatius, the original poster mentioned "an associative array" - The
[snip]
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 d
Devon --
...and then Devon said...
%
...
% SELECT id, name FROM a_table;
%
% I just cannot figure out how to get that data from the resource handle
% into an associative array with the 'id' colomn making up the keys and
% the 'name' colomn making up the values.
You won't get that directly;
Chris (Jon Kriek too, I guess),
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.
Thanks,
Rich
> -Original Messag
Chris, we think along the same lines - posted a similar concern seconds
before you.
--
Jon Kriek
http://phpfreaks.com
"Chris Boget" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > mysql_fetch_array( $result )
>
> Actually, for an associative array (which the OP had made refere
> 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:
Ignatius, the original poster mentioned "an associative array" - The
mysql_fetch_assoc() function fetches an associative array. If you want only
that, use that function, if you want indices, use the mysql_fetch_row()
function. If for some reason you need both, then you should use the
mysql_fetch_ar
$qry = "SELECT id, name FROM a_table";
$result = mysql_query($qry) or die(mysql_error());
while ($rs = mysql_fetch_row($result)) {
$myarray[$rs[0]] = $rs[1];
}
is that waht you need?
hth
Jeff
From: "Devon" <[EMAIL PROTECTED]>
> I have been scouring the online documentation and experimenting for
> hours trying to find a solution. I just can't do it.
>
> I have two colomns of data that I am retrieving from MySQL:
>
>SELECT id, name FROM a_table;
>
> I just cannot figure out how
mysql_fetch_array( $result )
_
- Original Message -
From: "Devon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 20, 2003 3:30 PM
Subject: [PHP-DB] Using two colomns of mysql data as key/value pairs in
arrays
> I have been scouring the online do
I have been scouring the online documentation and experimenting for
hours trying to find a solution. I just can't do it.
I have two colomns of data that I am retrieving from MySQL:
SELECT id, name FROM a_table;
I just cannot figure out how to get that data from the resource handle
into an as
I was thinking about using
$productid = md5(uniqid(rand(), true));
To generate product id's in my PHP/MySql database (primary & indexed in
mysql) to make the product number a little more different then 1,2,3,4.
Of course these product ID will need to be used in many SQL joins is there a
noticabl
On Thu, 16 Oct 2003, Dejan Milenkovic wrote:
> I'm not fammiliar with internal MySQL architecture and exactly how things
> work but I was wondering what is the most effcient way of spliting reports
> over multiple pages. Is there a preformance difference between these two
> codes, specialy if ther
Title: SQL type queries on arrays?
Hello,
I am developing an intranet application which parses a CSV file into a 2-D array, then searches for all unique values (PHP function) of a field and the most recent record in each case (foreach loops).
I have a working routine that takes about 15 sec
How can I get Unique ID from each user in LDAP, like the sid. Because I´m
making an database that stores every user Unique ID.
Please Reply !!!
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thank you Christopher!! I 've been looking for the solution a lot of time.
Thank you for the references too. Bye!!
Christopher Jones wrote:
Sergio Hernandez wrote:
Hi, we are working in php with oracle and we have a stupid problem.
We are trying to obtain the return value of a variable. But afte
Sergio Hernandez wrote:
Hi, we are working in php with oracle and we have a stupid problem.
We are trying to obtain the return value of a variable. But after
execute the function it give to us an empty value, its return 0 columns
and 1 row. We have prove this function in oracle and it give a go
Thank you Martin!!!
you've just saved my life!
; )
Regards
Ling.
"Martin Marques" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
El Dom 19 Oct 2003 13:54, Ling escribió:
> Hello there.
> Can anybody help me with Postgresql triggers?
> what I need is a trigger which inrements val
Hi, we are working in php with oracle and we have a stupid problem.
We are trying to obtain the return value of a variable. But after
execute the function it give to us an empty value, its return 0 columns
and 1 row. We have prove this function in oracle and it give a good result.
The code is :
75 matches
Mail list logo