Re: [PHP-DB] Include

2001-08-18 Thread CrossWalkCentral

so in var.php i will put something like this

$db="mydatabse";
$username="myusername";
$password="mypassword";


and so on?


--
Cross Walk Central
www.crosswalkcentral.net
Support Center
Your Web Hosting Community!

"Seb Frost" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> chuck all the common variables in var.php
>
> then just put
>
>  require("var.php");
> ?>
>
> - seb
>
> -Original Message-
> From: CrossWalkCentral [mailto:[EMAIL PROTECTED]]
> Sent: 19 August 2001 03:18
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Include
>
>
> OK here is one for you folks that know what you are doing.
>
> I am making a script and I have about 5 php files in it. That have alot of
> the same system variables can I create one file with these settings in it
> and if so any one want to give me some hints on this
>
> thanks again.
>
> --
> Cross Walk Central
> www.crosswalkcentral.net
> Support Center
> Your Web Hosting Community!
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Include

2001-08-18 Thread Seb Frost

chuck all the common variables in var.php

then just put 



- seb

-Original Message-
From: CrossWalkCentral [mailto:[EMAIL PROTECTED]]
Sent: 19 August 2001 03:18
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Include


OK here is one for you folks that know what you are doing.

I am making a script and I have about 5 php files in it. That have alot of
the same system variables can I create one file with these settings in it
and if so any one want to give me some hints on this

thanks again.

--
Cross Walk Central
www.crosswalkcentral.net
Support Center
Your Web Hosting Community!




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Include

2001-08-18 Thread CrossWalkCentral

OK here is one for you folks that know what you are doing.

I am making a script and I have about 5 php files in it. That have alot of
the same system variables can I create one file with these settings in it
and if so any one want to give me some hints on this

thanks again.

--
Cross Walk Central
www.crosswalkcentral.net
Support Center
Your Web Hosting Community!




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] saving to two tables at the same time

2001-08-18 Thread CrossWalkCentral

I got it it appears that i had forgotten my } at the end of my secound
insert

--
Cross Walk Central
www.crosswalkcentral.net
Support Center
Your Web Hosting Community!

"Jason Wong" <[EMAIL PROTECTED]> wrote in message
004c01c127a1$7efe56a0$[EMAIL PROTECTED]">news:004c01c127a1$7efe56a0$[EMAIL PROTECTED]...
> Do you have any code snippets for us to peruse?
>
> --
> Jason Wong
> Gremlins Associates
> www.gremlins.com.hk
>
>
> - Original Message -
> From: CrossWalkCentral <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, August 18, 2001 10:58 AM
> Subject: Re: [PHP-DB] saving to two tables at the same time
>
>
> > I have tried this but it has continued to fail the only way I have
gotten
> it
> > to work is via 2 diffrent php scrips
> >
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Table results returning 2 sets of the same row

2001-08-18 Thread Hugh Bothwell

Doh!  I meant extract($row);

"Ron Gallant" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I get
> Warning: Wrong parameter count for explode() in
> /www/chizeledlight/test.php on line 39
> when I use this code.
>
> The line in error is
> explode($row);



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Table results returning 2 sets of the same row

2001-08-18 Thread Ron Gallant

OK, I got it...

I used
$date = $row["date"];
 $news = $row["news"];
to define the rows.  Thats great.  I am a Cold Fusion user by trade and am
diving head first into PHP.  I like it a bunch.


"Ron Gallant" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I get
> Warning: Wrong parameter count for explode() in
> /www/chizeledlight/test.php on line 39
> when I use this code.
>
> The line in error is
> explode($row);
>
>
> "Hugh Bothwell" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> > "Ron Gallant" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > And my table results are shown 2 times per row.
> > > http://www.chizeledlight.com/test.php
> >
> > .. at a guess, you requested the same field twice
> > in your SELECT statement.
> >
> > I don't like the sample code given because it just
> > iterates through the rows rather than using their
> > names - if you alter your SQL, it could change the
> > column order, which is kinda non-intuitive.
> >
> > > I also don't know how to specify the column I want the result from.
> Like
> > > $columnName.
> >
> > Try this instead:
> >
> > $query =
> >  "SELECT field1,field2,field3 "
> > ."FROM tablename ";
> > $result = mysql_query($query);
> >
> > while ($row = mysql_fetch_array($result)) {
> > explode($row);
> > echo "\n$field1$field2$field3";
> > }
> >
> >
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Table results returning 2 sets of the same row

2001-08-18 Thread Ron Gallant

I get
Warning: Wrong parameter count for explode() in
/www/chizeledlight/test.php on line 39
when I use this code.

The line in error is
explode($row);


"Hugh Bothwell" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> "Ron Gallant" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > And my table results are shown 2 times per row.
> > http://www.chizeledlight.com/test.php
>
> .. at a guess, you requested the same field twice
> in your SELECT statement.
>
> I don't like the sample code given because it just
> iterates through the rows rather than using their
> names - if you alter your SQL, it could change the
> column order, which is kinda non-intuitive.
>
> > I also don't know how to specify the column I want the result from.
Like
> > $columnName.
>
> Try this instead:
>
> $query =
>  "SELECT field1,field2,field3 "
> ."FROM tablename ";
> $result = mysql_query($query);
>
> while ($row = mysql_fetch_array($result)) {
> explode($row);
> echo "\n$field1$field2$field3";
> }
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Filtering

2001-08-18 Thread Hugh Bothwell

"Felipe" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Will PHP have any kind of active filter such as ASP's rs.Filer Criteria
> And what about searching as ASP's rs.Find Criteria

... that's what SQL is for; in fact, I wouldn't be at all surprised
if these 'filters' get turned into SQL on the back end.



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Table results returning 2 sets of the same row

2001-08-18 Thread Hugh Bothwell


"Ron Gallant" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> And my table results are shown 2 times per row.
> http://www.chizeledlight.com/test.php

... at a guess, you requested the same field twice
in your SELECT statement.

I don't like the sample code given because it just
iterates through the rows rather than using their
names - if you alter your SQL, it could change the
column order, which is kinda non-intuitive.

> I also don't know how to specify the column I want the result from.  Like
> $columnName.

Try this instead:

$query =
 "SELECT field1,field2,field3 "
."FROM tablename ";
$result = mysql_query($query);

while ($row = mysql_fetch_array($result)) {
explode($row);
echo "\n$field1$field2$field3";
}



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Table results returning 2 sets of the same row

2001-08-18 Thread Ron Gallant

I used the code from this page
http://php.net/manual/en/ref.mysql.php

And my table results are shown 2 times per row.
http://www.chizeledlight.com/test.php

I also don't know how to specify the column I want the result from.  Like
$columnName.



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Filtering

2001-08-18 Thread Felipe

Will PHP have any kind of active filter such as ASP's rs.Filer Criteria
And what about searching as ASP's
rs.Find Criteria

???

Thanks



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: format dates from a database

2001-08-18 Thread Hugh Bothwell

"Caleb Walker" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am wondering if there is an easier way to format dates that come out of
a
> database.  My database stores my date in the format- "-MM-DD".  I know
> that I can take this and rearrange it with some string manipulation but is
> there any other easier way to do that say like making it say Sep. 09, 2001
> instead of 2001-09-09 without using ereg()?

sscanf("%d-%d-%d", $str, $year, $month, $day);
date("M. d, Y", mktime(0,0,0,$month,$day,$year));



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] format dates from a database

2001-08-18 Thread Caleb Walker

I am wondering if there is an easier way to format dates that come out of a 
database.  My database stores my date in the format- "-MM-DD".  I know 
that I can take this and rearrange it with some string manipulation but is 
there any other easier way to do that say like making it say Sep. 09, 2001 
instead of 2001-09-09 without using ereg()?

Thanks for your help

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Help with update...

2001-08-18 Thread BD

it's amazing.. I've been banging my head for over an hour on this, then as
soon as I send for help, I see the obvious - first of all, my error checking
was done *before* the query executed... then, to make it even more of an
effort in mindlessness, the table name capitalization was throwing it all
off!!

Sorry for the waste of good bandwidth...

~BD~



http://www.bustdustr.net
http://www.rfbdproductions.com
Home Of Radio Free BD
For The Difference.


- Original Message -
From: BD <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 18, 2001 12:21 PM
Subject: [PHP-DB] Help with update...


> I'm working under the gun here, so please excuse me if this turns out to
be
> something really simple, but it's got me stumped... I'm trying to update
the
> "cover" field in a table by using the album_id field in the table and
adding
> a ".jpg" extention to it...
> For example:
> "Update albums set cover = "1.jpg" where album_id = 1"
>
> For some reason, however, the update isn't working when executed... here
are
> the results I get:
>
> album_id: 1 - cover: 1.jpg
> UPDATE ALBUMS SET COVER = "1.jpg" WHERE ALBUM_ID = 1
> mysql_errno: 0:   mysql_error:
> Update Failed!
>
> As you can see, there's no error code generated, and the update statement
> works great from the command line...
>
> here's the relevant code (i'm connecting to the database as root, so i
don't
> think it's a permissions thing...):
> $query = "SELECT * FROM albums ORDER BY album_id";
>
> $stuff = mysql_query($query) or die("Select Failed!");
>
> while ($results = mysql_fetch_array($stuff)) {
>
>   $cover = $results['album_id'].".jpg";
>   $album_id = $results['album_id'];
>   echo $album_id." - ".$cover."";
>   $update = "UPDATE ALBUMS SET COVER = \"$cover\" WHERE ALBUM_ID =
> $album_id";
>   echo $update."";
>   echo mysql_errno().": ".mysql_error()."";
>   mysql_query($update) or die("Update Failed!");
>  }
>
>
> Simple... right? But it's beating me up this morning.. I would greatly
> appreciate it if anyone could show me the error of my ways...
>
> ~BD~
>
> http://www.bustdustr.net
> http://www.rfbdproductions.com
> Home Of Radio Free BD
> For The Difference.
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Help with update...

2001-08-18 Thread BD

I'm working under the gun here, so please excuse me if this turns out to be
something really simple, but it's got me stumped... I'm trying to update the
"cover" field in a table by using the album_id field in the table and adding
a ".jpg" extention to it...
For example:
"Update albums set cover = "1.jpg" where album_id = 1"

For some reason, however, the update isn't working when executed... here are
the results I get:

album_id: 1 - cover: 1.jpg
UPDATE ALBUMS SET COVER = "1.jpg" WHERE ALBUM_ID = 1
mysql_errno: 0:   mysql_error:
Update Failed!

As you can see, there's no error code generated, and the update statement
works great from the command line...

here's the relevant code (i'm connecting to the database as root, so i don't
think it's a permissions thing...):
$query = "SELECT * FROM albums ORDER BY album_id";

$stuff = mysql_query($query) or die("Select Failed!");

while ($results = mysql_fetch_array($stuff)) {

  $cover = $results['album_id'].".jpg";
  $album_id = $results['album_id'];
  echo $album_id." - ".$cover."";
  $update = "UPDATE ALBUMS SET COVER = \"$cover\" WHERE ALBUM_ID =
$album_id";
  echo $update."";
  echo mysql_errno().": ".mysql_error()."";
  mysql_query($update) or die("Update Failed!");
 }


Simple... right? But it's beating me up this morning.. I would greatly
appreciate it if anyone could show me the error of my ways...

~BD~

http://www.bustdustr.net
http://www.rfbdproductions.com
Home Of Radio Free BD
For The Difference.




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Accents and postgresql

2001-08-18 Thread Florian Blaser

Hi everybody !

I've got a quite confusing problem :

Yesterday, I upgraded my postgresql server from 7.0.3 to 7.1. I did some 
pg_dumps and created the DBS on the new server. Everything went fine.

But now, I've got some problems : When accessed through php, *sometimes* 
characters with accents don't come out right. I did some testing  and the 
results are here :

-psql doesn't have this problem, so I think it is not a postgresql related 
thing.
-When the database is created with a UNICODE encoding, accentuated characters 
appears as (xx). With a SQL_ANSII encoding, accentuated characters come out 
as other letters.
phpPgAdmin also has this problem, as well as all the websites I have written.

Has anybody else had this problem, or does someone sees where I could watch 
further, I'm quite stuck ?

Thanks a lot for your replies.

Florian Blaser

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Newbie: Modify - Delete entries

2001-08-18 Thread sg

Thank you Kate!

I'll try that, but I may need some more help on the way.

Cheers!

Sébastien.




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]