Hello all,
I asked this question on php-general last month
(http://marc.info/?t=12404923034r=1w=2), and received some answers
-- but I was directed to this list, so here.
My question is: can I tell programatically whether the next query I'm
going to execute is already part of a transaction,
$Addcart() -- is Addcart() a function (in which case you should remove
the dollar sign) or are you specifically trying to do some magic there
by running a function whose name is stored in that variable?
Bogdan
Robert Sossomon wrote:
I am seeing some errors with a program I wrote and I need to
Variable names are case-sensitive in PHP - try $HTTP_POST_VARS[first]
- or, for new versions of PHP, $_POST[first].
In another train of thoughts, please use the proper e-mail address - I'm
sure I'm not the only one using filters to automatically move mail to
folders and your although probably
For MySQL, see mysql_num_fields() and mysql_fetch_field() at
http://www.php.net
HTH
Bogdan
Casey Allen Shobe wrote:
How can I get the column headers from a query?
For example, on a 'select blah, blah2, blah3, something as blah4 from
whereever', I would want the blah, blah2, blah3, blah4,
. Unfortunately it didn't fix the issue. I am sorry
about the way the address message is displayed. There unfortunately
isn't anything I can do about it.
Jeffrey Norsworthy MCP, CCNA
Network Administrator
Community Health Services
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
Bogdan Stancescu [EMAIL
Also, if you check many URL's from the same script, make sure neither
PHP nor the browser times out. For PHP, set_time_limit() and for the
browser echo a space and flush() after each test.
Bogdan
Bogdan Stancescu wrote:
Try $fp=@fopen( etc
Bogdan
Tony wrote:
I have a database and I am
SELECT
FROM_DAYS(TO_DAYS(purchaseDate)-DAYOFYEAR(purchaseDate)+WEEK(purchaseDate)*7)
will hopefully return the date you need. You'll have to enclose all that
in a DATE_FORMAT to get a printable date tho. Last minute note: you
might have to subtract 1 from the last term because I guess MySQL
Just lose the WHERE city=\$city\ in the SQL.
Bogdan
Todd Williamsen wrote:
I know I have asked this silly question before, but forgive me since I have
been a bit rusty with PHP lately
So how do I return all rows?
I have this:
$sql= SELECT id, city, date FROM meetings WHERE city = \$city\ ;
. But it only returns one row
Bogdan Stancescu [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Just lose the WHERE city=\$city\ in the SQL.
Bogdan
Todd Williamsen wrote:
I know I have asked this silly question before, but forgive me since I
have
been a b
Well, the first question is what's the expected output?
If you're trying to get, say, title from table1 and rating from table2
and identify the books in table1 by the unique field id and in table2
by the field book_id, then this is what you should have to end up with:
SELECT t1.title,
$query=query;
$result=mysql_query($query);
$pd=mysql_result($result);
Notice the zig-zag - $query is first on the left side, then on the right
side, then $result is first on the left side, then on the right side.
Bogdan
Ryan Snow wrote:
Hi, Im kinda new to this list. Can anyone tell me what
PS. You should consider using mysql_fetch_row() or at least
mysql_fetch_array() for perforance reasons.
B
Bogdan Stancescu wrote:
$query=query;
$result=mysql_query($query);
$pd=mysql_result($result);
Notice the zig-zag - $query is first on the left side, then on the
right side
This is only part of the solution, but you should be aware that == is
a comparison operator whereas = is the assignment operator.
Bogdan
Killer Angel Clark wrote:
I add a checkbox in my page and will use the check result on another page.
If it is checked, it has no problem. However, if it is
No, at 1000+ you shouldn't have problems, almost no matter what
database/data you're using. You may start getting slowdowns at 100,000+
users if you have a lot of data and probably 500,000+ if you have the
reasonable data usually required.
Anyway, using a different database for each user
Well, there are quite some differences difference between the results
these two pieces of code yield. Let's see what your sql query would be
for the first version, replacing $deposit in $query:
UPDATE wt_users set bank_points + $user_depositset points - $user_deposit WHERE
uid={$session[uid]}
My first suggestion: replace all split() calls with explode() calls.
Bogdan
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
not checked for variables.
HTH
Bogdan
Bogdan Stancescu wrote:
My first suggestion: replace all split() calls with explode() calls.
Bogdan
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I'm constantly amazed how people can post such e-mails without first
checking freshmeat - it really takes longer to write the e-mail, you
know? This is what I came up with - out of sheer curiosity - in less
than a minute, by clicking on freshmeat, typing warehouse and clicking
on the project
Quoting from the MySQL manual:
In MySQL Version 3.23, you can use LIMIT # to ensure that only a given
number of rows are changed.
So then, it's LIMIT # instead of LIMIT #,#
Obviously, the way around it would be using WHERE instead of LIMIT, but
I don't know your table structure so I can't
You'll have to submit the data. Just that instead of pushing go, you can get
JavaScript to do that. For instance,
form name=myForm1 action=? echo $PHP_SELF?
select name=country onChange=document.myForm1.submit()
option value=Albania
option value=Andorra
/select
/form
form name=myForm2
Why don't you try
$denc[]=substr($text,$i,1);
Not to mention that $text[1] already is h.
Bogdan
Thomas \omega\ Henning wrote:
Something i forgot
when i echo($denc[1]); then it types Array out !!!
Thomas Omega Henning [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL
I've started a thread on the topic some time ago on the php list, after some
extensive reading and testing and these were the main conclusions:
1.1. ALWAYS pass addslashed values and always pass them quoted in the SQL
statement. That is insert into table1 set id='$id' even if $id is known to
$result = mysql_query(select * from equipment where (category='$category')
and (description like '%$description') and (roomloc='$roomloc') and
(quantity like '%$quantity') and (serialno like '%$serialno') and (patdue
like '%$patdue'),$db);
Gary Smith wrote:
Hiya, I'm writing a backend in
You seem to be doing it fine as far as I can see, except for song_id which should be
songs_id in the query...
Bogdan
Barry Rumsey wrote:
Hi
I have three tables set out below:
xp_artist: artist_id , artist _name
xp_sings: artist_id , songs_id
xp_songs: songs_id , song_name , lyrics
I
Just echo a link of the form a href=\lyrics.php?song_id=$song_id\Click for
lyrics/a and use the incoming song_id in lyrics.php to get it from the
database.
Bogdan
Barry Rumsey wrote:
I did not see that ( I must be blind hehe ). One other question , I have the
lyrics also stored in the
rawurlencode() does this trick.
Matthew Tedder wrote:
Quick question for anyone who knows,
Is there a PHP function to make data safe for sending in the query string?
$var = something or other;
// TODO: What is function to translate $var for querystring compatibility?
print a
In the printf() line after 5 6 7 you try to print %s 24 times but only provide 10
values. That may have something to do with it...
Bogdan
Jeff Moncrieff wrote:
Hello
I am trying make a script fatch my data form my mysql database. I use
this script but when execute it is says
Warning:
Those are two different things. You never mentioned your HTML problem, that's
why nobody adressed it.
So, the proper way to do it is:
1. Insert into the database using addslashes();
2. Use stripslashes() after retrieving the data if you need to;
3. Use htmlspecialchars() for displaying the data
-Original Message-
From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 04, 2002 1:41 PM
To: Jonathan Hilgeman
Cc: '[EMAIL PROTECTED]'
Subject: Re: [PHP-DB] Fixed Quote Marks in Inputs
That would be because this way you'll end up with the proper data in the
database
Ok, seems like I misjudged you and I apologize for that.
I haven't changed my opinion about the very issue we've been discussing - only
wanted to post the sentence above, just for the record.
Bogdan
Jonathan Hilgeman wrote:
Apparently, the experienced way is to store them with slashes, which
Ok, finally found a valid argument! :-)
What if the user enters I'm aware that 23!?
Bogdan
Jonathan Hilgeman wrote:
And I apologize if I came off as ultra-defensive/rude. I had a bad day, a
bright idea, and then felt like someone was tearing it to pieces. This is
like the PHP soap opera.
Why would this be a problem (i.e. the fact that a user may insert pre in a
form field)?
If you're worried about security (i.e. users adding JavaScript code) you can
always htmlspecialchars() the string...
Bogdan
louie miranda wrote:
Hi is it possible to match a certain string when a user
Bogdan Stancescu wrote:
Ok, finally found a valid argument! :-)
What if the user enters I'm aware that 23!?
Bogdan
Tested it - it works. However, you'll have big problems if you'll ever need to
echo the data. Consider this example:
Enter description: input box
The user enters Edited
Do you have control over where the file to be loaded is located? If so,
simply create a directory in your user's home, and do what the error message
says :-)
HTH
Bogdan
Hayan Al Mamoun wrote:
I have this error when I try to execute Load Data Infile ..
statement, although temp directory
In HTML:
SELECT name=manufacturernames[] multiple
(note the name has PHP-like array definition)
In PHP:
for ($i=0;$isizeOf($manufacturernames);$i++) {
if ($i==0) {
$q_cond=where;
} else {
$q_cond=or;
}
$query.=$q_cond MANUFACTURER LIKE '$manufacturernames[$i]';
}
Gisele Grenier
Bogdan Stancescu wrote:
In HTML:
SELECT name=manufacturernames[] multiple
(note the name has PHP-like array definition)
In PHP:
for ($i=0;$isizeOf($manufacturernames);$i++) {
if ($i==0) {
$q_cond=where;
} else {
$q_cond=or;
}
$query.=$q_cond MANUFACTURER LIKE
If everything else fails, you can retrieve unix_timestamp(date) and use PHP's
date() to format the output.
HTH
Bogdan
George Nicolae wrote:
for Win32(NT) and MSAcess 2000, whenever you retrieve a date column/field,
php will automatically convert it to '/mm/dd hh:mm:ss' format regardless
You actually have a time-out problem on exec_stmt(), because the for() can't
loop without executing all of the statements within.
You may want to start looking for ways to increase the time php waits for mysql
to execute a query.
Just to make sure I'm not senselessly babbling here, what does
I don't understand why you won't use forms with buttons and hidden controls
since you know about this solution. I have two suggestions along this line:
1. You probably don't want buttons on the page -- you may use image icons
instead (similar to a tape recorder's play and fast forward for next
Yup, that's the roulette selection, as they call it. It's pretty simple,
actually. The idea is that you use a concept similar to a roulette table,
just that the sectors aren't equal -- they're equal to their respective
weights. The procedure is as follows:
1. Assign the weighting to each of the
Jason Dulberg wrote:
I need to stick a little expiration date into a part of my site but can't
seem to get it going properly.
Your logic is ok -- DATE_ADD() is the function to work with. You don't give any
details about the actual problem you're having, but from the e-mail it seems
you're
select * order by id desc limit 1;
(obviously, id must be the field you yourself order the table by in your
mind when you say last row)
Necro wrote:
What query can I use to select the last row in a table??
Andrew
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail:
A sample of what you were trying would have been helpful...
If I understood your problem right, the solution is a piece of code like this:
?
echo(table\ntr\n);
while ($myrow=mysql_fetch_row($result))
{
$colcount++;
if ($colcount==$desiredcolcount)
{
$colcount=0;
}
43 matches
Mail list logo