Hi Everyone,
I want to first thank you for helping with the last question I had. It
didn't help but I finally figured it out. This one though has me stumped.
I have started using a portal script thinking I might be able to see a
little better how php works. It will do fine for me as far as my
Hello,
What's the difference between:
1.- $row[column_name];
2.- $row['column_name'];
3.- $row[column_name];
?
ragards Bart
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi there,
I am building a picture search engine with a gui where the user can choose
categories and then choose from those categories several points.
It is almost impossible to build a querry out of that. I am having a problem
keeping it dynamic. It works if I am naming the category, but I
Bart,
See this page for an explanation of quotes inside array brackets:
http://www.php.net/manual/en/language.types.array.php
Basically, the correct way to do it is to _always_ use quotes (single
quotes for strings without variables, and double quotes for strings with
variables). So your
how can you do that
Francisco Aquino wrote:
Can I access a Database like MsAccess without ODBC (DSNLess)
FAST!
Francisco Aquino
(Brasil - We're Not Indians)
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi there,
I have a tabel with 250 entries showing a country code lik CA
Now my application does not work on linux, because they have to be in lower
case.
Can I make anyhow an bufix, or even better creating a php function to change
all 250 entries to lower case.
I could not find the propper
On Thu, 7 Feb 2002 17:07:35 +0100
Andy Andy [EMAIL PROTECTED] wrote:
Hi there,
I have a tabel with 250 entries showing a country code lik CA
Now my application does not work on linux, because they have to be
in lower
case.
Can I make anyhow an bufix, or even better creating a php
Andy,
You can do it with PHP's strtolower() function..
See:
http://www.php.net/manual/en/function.strtolower.php
Gurhan
-Original Message-
From: Andy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 07, 2002 11:08 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Converting upper case
Hi there,
my app works fine on win2k and os x. After porting to linux I get following
errormsg:
Occured during executing CREATE TEMPORARY TABLE IF NOT EXISTS ranking (
user_id INTEGER, ranking INTEGER ) statement
Error: 3 Error writing file '/tmp/#sql451_86_0.frm' (Errcode: 28)
I have no
strtolower()
-Original Message-
From: Andy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 07, 2002 8:08 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Converting upper case letters to lower case because of
db??
Hi there,
I have a tabel with 250 entries showing a country code lik CA
Is there an easy way to get a dump to the page of all session varibles?
I'm trying to create an associtave array in a session varible named cart
($item1 =$qty1, $item3=$qty2, etc.) and i can't seem to wrap my brain
around it this morning. I get the item set but can't get the $qty to set.
I created a couple of forms where one inserts new contact data with a file,
in this case its a resume. Now, I want to create a form where a user can
update the information by inserting their updated information and if there
is a new resume then it would be uploaded.
I got the upload part down,
Yes you can, i forget how though... I dropped the ODBC and MS databases a
year ago... I wish I remembered!
Kerem Can Karakas [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
how can you do that
Francisco Aquino wrote:
Can I access a Database like MsAccess
Jennifer...
$query=select name, days from wt_users where uid=$uid;
change to:
$query=SELECT name, days FROM wt_users WHERE uid=\$uid\ ;
You also need to make sure the page that is calling this script has a valid
value of $uid otherwise it won't work.
Jennifer Downey [EMAIL PROTECTED]
Like so:
echopre;
print_r($_SESSION);
echo/pre:
I think for PHP less 4.04, you need $HTTP_SESSION_VARS Instead.
JD
-Original Message-
From: Robert Weeks [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 07, 2002 8:45 AM
To: php
Subject: [PHP-DB] Viewing Session Varibles
Is there
I've got 2 MySQL tables: Employees, and Mileage. Mileage records trips
for
employees and there may be 0 or more Mileage rows for each Employee
row. The Mileage table has a trip_date column. For testing purposes,
the
trip_date column in all rows is set to 2002-03-01.
There are currently 15 rows
On Friday 08 February 2002 00:14, Raquel Rice wrote:
On Thu, 7 Feb 2002 17:07:35 +0100
Andy Andy [EMAIL PROTECTED] wrote:
Hi there,
I have a tabel with 250 entries showing a country code lik CA
Now my application does not work on linux, because they have to be
in lower
case.
Ok,
This is driving me nuts. I'm sure its something simple but I can't seem to
find the glitch.
I'm trying to make a simple shopping cart using Session varibles to store
the item = quantity pairs, then I loop thru the cart and query the db to
get the item details, etc.. Most of it works fine
On Friday 08 February 2002 00:18, Andy wrote:
Hi there,
my app works fine on win2k and os x. After porting to linux I get
following errormsg:
Occured during executing CREATE TEMPORARY TABLE IF NOT EXISTS ranking (
user_id INTEGER, ranking INTEGER ) statement
Error: 3 Error writing
hmmm... If I was you.. I would make your cart an object.. build a simple
class like:
class Cart
{
var $items;
function Cart()
{
$this-items=Array();
}
function Add_To_Cart($item)
{
if(!in_array($item,$this-items)
Hi,
Someone pointed out that I should quote key in arrays.
If I do this:
input type=hidden location=$input[keynameherewithquotes]
or just this:
$input[REQUEST_URI]
in a heredoc
I get the following
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in
Hi!
Is there a way to get the rows with id's like 1, 3, 5, and so on or 2, 4, 6,
...?
Best regards Raymond
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Here are the 2 tables and selected columns from each. Note there are only 4
employees who
have trips (3 of those employees active, 1 inactive).
If I do the following select, I only get 4 rows returned (or 3 if I say
'where active = 'A'). In addition to those, I want 1 row returned for each of
Yes, but the question is why?
-Original Message-
From: Raymond Lilleodegard [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 07, 2002 1:22 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Query with numbers like 1, 3, 5..
Hi!
Is there a way to get the rows with id's like 1, 3, 5,
select * from table where id in (1,3,5,10,'etc')
At 08:22 PM 2/7/2002 +0100, Raymond Lilleodegard wrote:
Hi!
Is there a way to get the rows with id's like 1, 3, 5, and so on or 2, 4, 6,
...?
Best regards Raymond
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe,
Yes,
Even Numbers:
SELECT * FROM table WHERE MOD(id,2) = 0;
Odd Numbers:
SELECT * FROM table WHERE MOD(id,2) != 0;
- Jonathan
-Original Message-
From: Jeremy Peterson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 07, 2002 11:59 AM
To: Raymond Lilleodegard; [EMAIL PROTECTED]
On Friday 08 February 2002 03:30, Peter J. Schoenster wrote:
Hi,
Someone pointed out that I should quote key in arrays.
What someone forgot to point out was that within double-quoted strings you
should not quote the keys.
If I do this:
input type=hidden
I have a script that calls a function to perform a query using the
arguments sent to the function via http form processing.
I get two entries into the MySQL database for one query.
I only want one entry.
Can someone point me in the right direction?
Thanks in advance.
Justin Hall
JD
And the answer is:
mysql select e.id,fname,sum(m.miles) from employees e
- left join mileage m on m.id=e.id month(trip_date)=3
- substring(year(m.trip_date),3,2) = '02'
- group by e.id;
yeilds:
+---++--+
| id| fname
Ya haven't given us much to go on. So...
SELECT DISTINCT * FROM mytable WHERE some condition;
-Original Message-
From: Justin Hall [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 07, 2002 2:24 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] duplicate entries in db
I have a script that
Hi all.
I have the following configuration:
I'm running a Cobalt RAQ4i with Linux
Apache Web Server
PHP Version 4.0.3pl1
We have an application which is used via ssl.
There are occassions when a user presses on a submit button to post
information to a database. The script itself is fine,
Hello all,
I'm very new to php and have been beating my head on the wall over this for 2
days. I've searched through the php documentation but I guess I either don't
know where or what to look for or don't understand what I'm seeing.
I think this has to be an array but the original doesn't seem
Hi again Rick! : )
It is because I am trying to list all products that I have in a database
into a menu page. And I would like to have two products beside eachothers.
So... is it possible to get two datarows in one:
do {
} while (mysql_fetch_array() );
?? or is this a stupid way to do it?
I think you're on the right path.
It sounds like what you REALLY want is two equal length columns of products.
In that case, instead of 1,3,5,7,... which will become upset when you add
and delete products; use mysql_num_rows($result). That is:
$query=SELECT * FROM products WHERE some
? whatever... ?
table border=1
?
$qry = mysql_query(select * from tablename order by id);
while ( $ref1 = mysql_fetch_object($qry) ) {
$ref2 = mysql_fetch_object($qry)
?trtd$ref1-id nbsp;/tdtd$ref2-id nbsp;/td/tr?
}
?
/table
btw, the nbsp; is to keep the internal cell borders from not
I like Mike's WHILE-loop better than my solution.
thanks, Mike
-Original Message-
From: Mike Gohlke [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 07, 2002 3:56 PM
To: Raymond Lilleodegard; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Query with numbers like 1, 3, 5..
?
The following means you have not opened a link to your database.
Concerntrate your efforts there.
Warning: Supplied argument is not a valid MySQL-Link
resource in /var/www/html/list.php3 on line 26
-Original Message-
From: Ken Thompson [mailto:[EMAIL PROTECTED]]
Sent: Thursday,
Thank's a lot guys for helping me out here!
Now I can sleep well to night ; )
Mike Gohlke [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
? whatever... ?
table border=1
?
$qry = mysql_query(select * from tablename order by id);
while ( $ref1 =
you can take the function substr from php in combination with strlen (lenght
of a string)
example
$string = 1234567890;
$rest = substr($string, 0, strlen($string)-3); // returns 1234567
Success Jeroen Timmers
- Original Message -
From: Renaldo De Silva [EMAIL PROTECTED]
To: [EMAIL
I have a Notes field where users can add notes. Now, there will be times
when they use quotes or maybe even HTML, what is the correct way of using
this function?
I have tried:
addslashes($Notes);
and
$Notes addslashes($Notes);
neither work..
I thought I would ask this great newsgroup!
Try
$Notes = addslashes($Notes);
You where almost right :)
/Alexander
- Original Message -
From: Todd Williamsen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 07, 2002 11:32 PM
Subject: [PHP-DB] addslashes()
I have a Notes field where users can add notes. Now,
Ok..
i tried it out... and it almost works like I want it... weird though
1. when I put in pfont color=bluethis is BLUE/p/font
it prints it in like a bright green. but if i use the RGB # then its fine.
weird
2. if there is an apostrophe in the notes, then it will add slashes it to
that
Hello,
I am trying to set up a session management system for my site. Check out
my site (under development) http://www.planttel.com/newsite2/home.php
I have a user auth system installed already. What I want is when a
customer clicks on log in that it will prompt them for a user name and
password
Ahha, i see.
Hmm well you can make your own addslashes function like this. Add the
following line at the beginning of the php code
function superaddslashes($input) {
return ereg_replace ('', '\', $input);
}
Then you can do
$Notes = superaddslashes($Notes);
- Original Message
At 16:54 -0600 2/7/02, Todd Williamsen wrote:
Ok..
i tried it out... and it almost works like I want it... weird though
1. when I put in pfont color=bluethis is BLUE/p/font
it prints it in like a bright green. but if i use the RGB # then its fine.
weird
2. if there is an apostrophe in
Paul,
It is being inserted into a database
-Original Message-
From: Paul DuBois [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 07, 2002 5:41 PM
To: Todd Williamsen; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] addslashes()
At 16:54 -0600 2/7/02, Todd Williamsen wrote:
Ok..
i tried it
Hi Danny, you could use a cookie to store the user's username and password
once they first successfully login the first time or even better upon
signing up to your site. Then, on the login page(or whatever page is
displayed prompting a login) you could check for the cookie at the top and
redirect
Hi. addslashes() going in to db, stripslashes() coming out :)
HTH Joe :)
Todd Williamsen [EMAIL PROTECTED] wrote in message
002601c1b033$382a4700$f6b2d83f@goofy1">news:002601c1b033$382a4700$f6b2d83f@goofy1...
Paul,
It is being inserted into a database
-Original Message-
From:
I need to delete the last 3 character of a string, what command can i use o
do this.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
$str = substr($str,0,-3);
-Original Message-
From: Renaldo De Silva [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 07, 2002 1:57 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-DB] Need to delete charcters from a string
I need to delete the last 3 character of a string,
Hi Ken,
The %s is a method of formatting a string. Why not try echo or print
command instead?
As for the other problem on line 26, the mysql_query returns a resource id #
(an integer). You'll have to use that number in your loop to retrieve the
results after.
Here's an example:
$connectionid
Hi. Post up some code so the ng can help you out. :)
Justin Hall [EMAIL PROTECTED] wrote in message
01c1b015$54445250$fdd80918@CT41311A">news:01c1b015$54445250$fdd80918@CT41311A...
I have a script that calls a function to perform a query using the
arguments sent to the function via
Why couldn't you use something like this:
$mystr = substr($mystr, -3);
Joe
Jeroen Timmers [EMAIL PROTECTED] wrote in message
003001c1b026$97373cb0$7f6440d4@jeroen">news:003001c1b026$97373cb0$7f6440d4@jeroen...
you can take the function substr from php in combination with strlen
(lenght
of a
Try looking at the unlink() function. It removes files off of the web
server.
HTH Joe :)
Todd Williamsen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I created a couple of forms where one inserts new contact data with a
file,
in this case its a resume.
ammendment:
use the unlink() function once you have confirmation of a successful update
:)
HTH Joe :)
Todd Williamsen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I created a couple of forms where one inserts new contact data with a
file,
in this case its
Does anyone know how to limit a long record, like a news article that has 5
pages?
I want to limit it so it displays the first page then at the bottom it
prints:
1 2 3 4 5 6 7
then when you click 2 or the right arrow it displays the second page of
the record?
I have been trying to use
On 7 Feb 2002, at 18:36, Danny Kelly wrote:
Hello,
I am trying to set up a session management system for my site. Check
out my site (under development)
http://www.planttel.com/newsite2/home.php I have a user auth system
installed already. What I want is when a customer clicks on log in
I have worked my problem down to the mysql database.
I have a table like so:
Field
Type
Attributes
Null
Default
Extra
username
varchar(16)
No
commID
int(9)
No
auto_increment
commState
char(2)
No
commCity
varchar(25)
No
commZip
int(5)
No
0
Hi All,
I am trying to build a search engine for a directory.
So far I have setup a table of keywords [ id |
category_id | keyword ] with a single keyword and the
category that it refers to. Then I have a table of
categories [ cat_id | parent_id | cat_name ] and a
table of vendors linked to the
59 matches
Mail list logo