RE: [PHP-DB] database abstraction for php3

2001-07-25 Thread Walter, Marcel

I use the CDBAbstract but don´t know if it is possible to
use it with PHP3 ...
Just give it a try

Go to http://www.zend.com/codex.php?id=105single=1

Although I have changed it a bit to fit my needs the version
you get there is quite good ...

Cheers,
Marcel

 -Original Message-
 From: Geoffrey Makstutis [SMTP:[EMAIL PROTECTED]]
 Sent: Tuesday, July 24, 2001 17:35
 To:   [EMAIL PROTECTED]
 Subject:  [PHP-DB] database abstraction for php3
 
 Hi,
 
 Can anyone suggest a good (and simple) database abstraction class for
 php3?
 
 I have been using ADODB, but it doesn't like php3.
 
 Thanks
 -
 Geoffrey Makstutis
 [EMAIL PROTECTED]
 
 51% Studios
Architecture + Design
1-5 Clerkenwell Road
London EC1M 5PA
 
www.51pct.com
 
 -- 
 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]


If you have received this e-mail in error or wish to read our e-mail disclaimer 
statement and monitoring policy, please refer to
http://www.drkw.com/disc/email/ or contact the sender.

--
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] line breaks in mySQL text fields

2001-07-25 Thread Caleb Walker

On Monday 23 July 2001 11:16 am, kmurrah wrote:
 How do I add new line characters to a text field in mySQL ?

 i.e. i need to manually insert returns into my text ...

 thanks in advance,

 KennM

Does the \n not work?  I dont have time to try it write now but did you try 
it?

-- 
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: another php/mysql problem

2001-07-25 Thread Markus Wagner



Matt Nigh schrieb:

 Matt Nigh

 ?php
 $link = mysql_connect(localhost,username,password);
 if(!$link) die (Could not connect to MySQL!);
 mysql_select_db(almavale_board,$link);
 if (!isset($band)) {
 die(No artist specified.);
 }
 $sql = select * from bands where (nospaces_bands = '$band');
 $result = mysql_query($sql);
 if (mysql_num_rows($result) = 0) {
 die(Sorry, there was no artist found by that name.);
 }
 if (!$my_row = mysql_fetch_array($result)) {
 die(Please specify an artist.);
 }
 $band = nospaces_bands;
 $band_spaces = band_bands;
 $id = id;
 $email = email;
 echo bband name without spaces:/b  . $my_row[$band];
 echo brbband name with spaces:/b  . $my_row[$band_spaces];
 echo brbid:/b  . $my_row[$id];
 echo brbemail address:/b  . $my_row[$email];

 $band_spaces = $artist;

 mysql_select_db(almavale_board,$link);
 $sql_01 = select * from shows where (artistname = '$artist');
 $result_01 = mysql_query($sql_01);
 if (mysql_num_rows($result_01) = 0) {
 die(brbrNo shows found.);
 }
 $my_row_01 = mysql_fetch_array($result_01);

 $artist = artistname;
 $venue = venue;
 $time = time;
 echo brbrhrbartist name with spaces:/b  . $my_row_01[$artist];
 echo brbvenue:/b  . $my_row_01[$venue];
 echo brbtime:/b  . $my_row_01[$time];

 $artist = $band_name;

 mysql_select_db(almavale_releases,$link);
 $sql_02 = select * from releases where (bandname = '$band_name');
 $result_02 = mysql_query($sql_02);
 if (mysql_num_rows($result_02) = 0) {
 die(No releases found.);
 }
 $my_row_02 = mysql_fetch_array($result);
 $band_name = bandname;
 $albumtitle = albumtitle;
 $email = email;
 echo brbrhrbartist name with spaces from releases:/b  . 
$my_row_02[$artist];
 echo brbalbum name:/b  . $my_row_02[$albumtitle];
 echo brbalbum code:/b  . $my_row_02[$albumcode];

 mysql_close($link);
 ?

What do you exactly want to do?

And what is that?

$band = nospaces_bands;
$band_spaces = band_bands;
$id = id;
$email = email;

Why don't you do this:

echo bband name without spaces:/b  . $my_row[band];
echo brbband name with spaces:/b  . $my_row[band_spaces];
echo brbid:/b  . $my_row[id];
echo brbemail address:/b  . $my_row[email];

Greetings

Kobi


-- 
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] draw graph

2001-07-25 Thread Sommai Fongnamthip

Dear,
How could I draw graph with gd by using PHP code with custom log scale?

Sommai Fongnamthip


-- 
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] PHP - MySQL

2001-07-25 Thread Pranot Kokate

Dear friends,

how can i monitor/count how many times a button is clicked. The code should not be on 
the page which comes after clicking, but on the same page where the button is. This is 
the need

pls help

regards,
pranot



[PHP-DB] search database

2001-07-25 Thread J- E- N


can you suggest how to do a database search aside from using like in my
query string.

thanks a lot


-- 
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] search database

2001-07-25 Thread Seb Frost

Could you be more specific?  You can do ANYTHING using the select command.

- seb


-Original Message-
From: J- E- N [mailto:[EMAIL PROTECTED]]
Sent: 25 July 2001 12:02
To: [EMAIL PROTECTED]
Subject: [PHP-DB] search database



can you suggest how to do a database search aside from using like in my
query string.

thanks a lot


-- 
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] Question regarding php and mysql with binary data...

2001-07-25 Thread Mitrana Cristian

Koutsogiannopoulos Karolos wrote:

Hello Again everyone...

My question is simple...

I have images submited IN my mysql Database.
What i want is when i display them and i right click on them and choose save
picture as i can get the name of the 
picture from the DB and not have to insert it my self.
Does anyone now how can i do that with a file that comes from a db???

thanks
___
PGP KEY ID: 0xA86600E9
___

You have store in the DB also the original file name,
I assume you store the image using a BLOB field, so
when you store the image in that field it does not
retain the name of the file.
 I made somth. like this once and used a php script
as a "image" target to retreieve the image with it's
original name and type (.gif, .jpg, .png etc).
 regards,
  mitu



-- 
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] draw graph

2001-07-25 Thread Dobromir Velev

Check http://www.phplot.com
I think it could be helpful

Dobromir Velev

-Original Message-
From: Sommai Fongnamthip [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
Date: Wednesday, July 25, 2001 11:35 AM
Subject: [PHP-DB] draw graph


Dear,
 How could I draw graph with gd by using PHP code with custom log scale?

Sommai Fongnamthip


-- 
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] PHP - MySQL

2001-07-25 Thread Dobromir Velev

Hi,
you could point the form to submit itself to the same page, log the click
and then redirect to the next page with heade(Location: next_page.php);

Hope this helps
Dobromir Velev

-Original Message-
From: Pranot Kokate [EMAIL PROTECTED]
To: PHP-DB list [EMAIL PROTECTED]
Date: Wednesday, July 25, 2001 11:56 AM
Subject: [PHP-DB] PHP - MySQL


Dear friends,

how can i monitor/count how many times a button is clicked. The code should
not be on the page which comes after clicking, but on the same page where
the button is. This is the need

pls help

regards,
pranot



-- 
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] Allowing refresh without form processing?

2001-07-25 Thread John Pickett

Hey,

I have a page where I'd like to allow the client to use their refresh
button.  The only problem with this is, when they submit a form that's on
the page, it is parsed by the same page.  So if they hit refresh, the same
information will be submitted twice (or more).  How can I clear out any
knowledge that a form was submitted?  I've tried adding unset
($HTTP_POST_VARS); to the bottom of the page but that didn't do anything for
it...  Any other ideas?

BTW, I'm asking this because the form uses a db to process and I'm unsure if
that may be the issue or not...

My 2 ¢
John Pickett
http://www.bvstudios.com/
Co-Author:  Inside Dreamweaver 4
http://www.amazon.com/exec/obidos/ASIN/0735710848/xtremist



-- 
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: draw graph

2001-07-25 Thread Hugh Bothwell


Sommai Fongnamthip [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Dear,
 How could I draw graph with gd by using PHP code with custom log scale?

How 'bout:

function drawLogGraph($arr) {
$xoffs = 20;
$yoffs = 180;
$drawwidth = 160;
$drawheight = -160;

$logscale = -10;// height of a 10x division
$logscalebase = 1;// '0' on your graph

$numbars = count($arr);
$perbar = $drawwidth / $numbars;

$barwidth = 0.8;  // ... fractional draw width
$halfsp = (1 - $barwidth) * 0.5;

$img = ImageCreateFromPNG(graphbackground.png) or die(Could not load
background);

for ($i = 0; $i  $numbars; $i++) {
$barleft = $perbar * ($i + $halfsp);
$barright = $perbar * ($i + 1 - $halfsp);
$bartop = (log10($arr[$i]) - $logscalebase) * $logscale;

ImageFilledRectangle($img, $xoffs + $barleft, $yoffs + $bartop,
$xoffs + $barright, $yoffs, 1);
}

return $img;
}



-- 
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] Allowing refresh without form processing?

2001-07-25 Thread Dobromir Velev

Hi,
Name your form submit button somehow, for example
input type=Submit name=my_submit_button value=Submit

then when the page is refresh check if there is a variable named
$my_submit_button. If there is not than the page is refreshed using the
refresh button or the form was submitted with th Enter key.
You will process the form only when there is variable $my_submit_button
which means that someone has pressed the submit button.

Dobromir Velev
-Original Message-
From: John Pickett [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
Date: Wednesday, July 25, 2001 4:59 PM
Subject: [PHP-DB] Allowing refresh without form processing?


Hey,

I have a page where I'd like to allow the client to use their refresh
button.  The only problem with this is, when they submit a form that's on
the page, it is parsed by the same page.  So if they hit refresh, the same
information will be submitted twice (or more).  How can I clear out any
knowledge that a form was submitted?  I've tried adding unset
($HTTP_POST_VARS); to the bottom of the page but that didn't do anything
for
it...  Any other ideas?

BTW, I'm asking this because the form uses a db to process and I'm unsure
if
that may be the issue or not...

My 2 ?
John Pickett
http://www.bvstudios.com/
Co-Author:  Inside Dreamweaver 4
http://www.amazon.com/exec/obidos/ASIN/0735710848/xtremist



--
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] Making a new row in HTML tables

2001-07-25 Thread Ian Grant

Hi,

Can anyone help me with this - I have a database of people, that I want to
print into an HTML table - how can I make the table wrap into an equal
number of rows.
i.e. if there are 4 entries, a 2x2 table, 6 a 2x3, 8 a 2x4, 9 a 3x3, etc.

At the moment, I have something like:

$rows=mysql_num_rows($result);
$i=1;

while ($array = mysql_fetch_array($result))  {

  print (td
align=\center\.$array[Image].br.$array[Name]./td\n);

 if (is_int($rows / $i)) {
  print (/tr\ntr);
  }

 $i++;
  }

Thanks,

Ian.

--




-- 
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: Making a new row in HTML tables

2001-07-25 Thread Hugh Bothwell

Umm... 31 entries, 1 x 31...

You might be better to choose a standard width and pad the last row with
empty cells.

Ian Grant [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 Can anyone help me with this - I have a database of people, that I want to
 print into an HTML table - how can I make the table wrap into an equal
 number of rows.
 i.e. if there are 4 entries, a 2x2 table, 6 a 2x3, 8 a 2x4, 9 a 3x3, etc.




-- 
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: Making a new row in HTML tables

2001-07-25 Thread Ian Grant

Yeah, but if I had 31,
I'd want 6x5 and then 1 over, or something


Hugh Bothwell [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Umm... 31 entries, 1 x 31...

 You might be better to choose a standard width and pad the last row with
 empty cells.

 Ian Grant [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi,
 
  Can anyone help me with this - I have a database of people, that I want
to
  print into an HTML table - how can I make the table wrap into an equal
  number of rows.
  i.e. if there are 4 entries, a 2x2 table, 6 a 2x3, 8 a 2x4, 9 a 3x3,
etc.






-- 
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] Re: Making a new row in HTML tables

2001-07-25 Thread Mark Roedel

 -Original Message-
 From: Ian Grant [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 25, 2001 11:28 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Re: Making a new row in HTML tables
 
 
 Yeah, but if I had 31,
 I'd want 6x5 and then 1 over, or something

What about 16?  2x8, 4x4, or 8x2?  And how would we decide which?
Would 34 be 2x17, or 6x5 with 4 over?
 
I'm with Hugh...unless you can define more clearly the rules you want
this thing to operate under, the easiest thing is probably going to be
to just pick a standard width and pad the last row.  If you wanted to
define special exceptions for total counts less than some arbitrary
number (30?), that ought to be simple enough to do manually.  Something
like...

   switch ($picture count) {
.
.
.
 case 4: $row_width=2; break;
 case 6: $row_width=3; break;
 case 8: $row_width=4; break;
 case 9: $row_width=3; break;
 default: $row_width=6;
   }

should do the trick.


---
Mark Roedel   | The most overlooked advantage to owning a
Systems Programmer|  computer is that if they foul up there's no
LeTourneau University |  law against whacking them around a little.
Longview, Texas, USA  |  -- Owen Porterfield 

 
 Hugh Bothwell [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Umm... 31 entries, 1 x 31...
 
  You might be better to choose a standard width and pad the 
 last row with
  empty cells.
 
  Ian Grant [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   Hi,
  
   Can anyone help me with this - I have a database of 
 people, that I want
 to
   print into an HTML table - how can I make the table wrap 
 into an equal
   number of rows.
   i.e. if there are 4 entries, a 2x2 table, 6 a 2x3, 8 a 
 2x4, 9 a 3x3,
 etc.
 

--
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] Question on how to test a value

2001-07-25 Thread Lara J. Fabans

Hi, friends,

Here is how I'm putting the information into the database:
$query7 = isset($price) ? INSERT INTO price (itemid, price) VALUES ($itemid, 
'$price') : 0;
$result7 = @pg_Exec($connection, $query7 );

I'm having difficulties with my test in display.
I've tried isset and == 'NULL' and == '0' as such:

if ($values2 == 'NULL')
{
   print trtd class=\display\nbsp;/td/tr;
} else
{
print trtd class=\display\US$ $values2-price/td/tr/table/td;
}


and


if (isset($values2))
{
   print trtd class=\display\US$ $values2-price/td/tr/table/td;
} else
{
print trtd class=\display\nbsp;/td/tr;
}


However, in both cases, if the price doesn't exist in the database, the  US$ still 
shows up in the
display.

db= select * from price where itemid=50;
 priceid | itemid | price 
-++---
  48 | 50 | 
(1 row)


I was surprised that the insert put something into the database at all.

I could use some advice.  

I cleaned up the database to remove all the lines where price wasn't set.
Why is it creating a table row?  If the insert form is passing in where they didn't 
set the price,
wouldn't that get picked up by the isset?  

And if there isn't a row in the database, wouldn't testing isset of the result of the 
query be
sufficient, or should I do a test on $values2-price instead?

I've tried lots of things and nothing seems to be doing the right behavior.  So thanks!
Lara



RE: [PHP-DB] Re: Making a new row in HTML tables

2001-07-25 Thread Robert Klinkenberg

Or 5x6 and 1 over...

But if you want to minimise the number of blank fields, you could
determine a max number of columns (and a minimum number of colums) that
you want to display and calculate the number of blank fields for all
posibilities
combinations.
Choose the one that minimises the number of blank fields.

Robert Klinkenberg


 -Oorspronkelijk bericht-
 Van:  Ian Grant [SMTP:[EMAIL PROTECTED]]
 Verzonden:Wednesday, July 25, 2001 6:28 PM
 Aan:  [EMAIL PROTECTED]
 Onderwerp:[PHP-DB] Re: Making a new row in HTML tables
 
 Yeah, but if I had 31,
 I'd want 6x5 and then 1 over, or something
 

-- 
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] Re: Making a new row in HTML tables

2001-07-25 Thread Seb Frost

Well it seems what you're trying to do is to set as square a table as you
can.  So, take your number of entries and square root it.  Now round it up.
Now divide the number of entries by that number and again round up.  Now use
these two numbers to make the table.  Should be pretty straighforward...

- seb

-Original Message-
From: Ian Grant [mailto:[EMAIL PROTECTED]]
Sent: 25 July 2001 17:28
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: Making a new row in HTML tables


Yeah, but if I had 31,
I'd want 6x5 and then 1 over, or something


Hugh Bothwell [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Umm... 31 entries, 1 x 31...

 You might be better to choose a standard width and pad the last row with
 empty cells.

 Ian Grant [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi,
 
  Can anyone help me with this - I have a database of people, that I want
to
  print into an HTML table - how can I make the table wrap into an equal
  number of rows.
  i.e. if there are 4 entries, a 2x2 table, 6 a 2x3, 8 a 2x4, 9 a 3x3,
etc.






--
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] Re: another php/mysql problem

2001-07-25 Thread Matt Nigh

ok, well it looks like no one really understood my problem, which is ok
because didn't explain it well. i can barely understand myself what i'm
trying to do, but what i'll try doing is just telling you all what exactly i
need to happen.

ok, i have 3 tables, two of them (bands, shows) being in a DB named
almavale_board and the other table (releases) being in a DB named
almavale_releases. essentially what i want to have is a bands page that
displays a bio, links etc. (from the bands table), their releases (releases
table) and their shows (shows table). i need to pull this data from the two
DBs and then display them so each band has their own page, but it runs off
the same page (ie. bands.php). so what i want to have is
http://site.com/bands.php?band=thebandsname and then since i've defined the
variable $band in the URL, only the info from the row in the
'nospaces_bands' column with the value 'thebandsname' will be displayed.
then from that, the shows table will take the value from one of the columns
in the 'bands' table named 'band_bands' and will find all the records in the
shows table that have that same value in the column 'artistname'. then from
there, the releases table in the 'almavale_releases' DB will take the value
from the column 'artistname' in the 'shows' table and  will find all the
records in the releases table that have that same value in the column
'bandname'. so basically, i wanna pass multiple variables across these
tables/databases and display all the records that match each one. it's
pretty confusing, so i hope i explained it well enough for all to
understand.

thanks,


Matt


- Original Message -
From: Markus Wagner [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 25, 2001 5:25 AM
Subject: [PHP-DB] Re: another php/mysql problem




 Matt Nigh schrieb:

  Matt Nigh
 
  ?php
  $link = mysql_connect(localhost,username,password);
  if(!$link) die (Could not connect to MySQL!);
  mysql_select_db(almavale_board,$link);
  if (!isset($band)) {
  die(No artist specified.);
  }
  $sql = select * from bands where (nospaces_bands = '$band');
  $result = mysql_query($sql);
  if (mysql_num_rows($result) = 0) {
  die(Sorry, there was no artist found by that name.);
  }
  if (!$my_row = mysql_fetch_array($result)) {
  die(Please specify an artist.);
  }
  $band = nospaces_bands;
  $band_spaces = band_bands;
  $id = id;
  $email = email;
  echo bband name without spaces:/b  . $my_row[$band];
  echo brbband name with spaces:/b  . $my_row[$band_spaces];
  echo brbid:/b  . $my_row[$id];
  echo brbemail address:/b  . $my_row[$email];
 
  $band_spaces = $artist;
 
  mysql_select_db(almavale_board,$link);
  $sql_01 = select * from shows where (artistname = '$artist');
  $result_01 = mysql_query($sql_01);
  if (mysql_num_rows($result_01) = 0) {
  die(brbrNo shows found.);
  }
  $my_row_01 = mysql_fetch_array($result_01);
 
  $artist = artistname;
  $venue = venue;
  $time = time;
  echo brbrhrbartist name with spaces:/b  .
$my_row_01[$artist];
  echo brbvenue:/b  . $my_row_01[$venue];
  echo brbtime:/b  . $my_row_01[$time];
 
  $artist = $band_name;
 
  mysql_select_db(almavale_releases,$link);
  $sql_02 = select * from releases where (bandname = '$band_name');
  $result_02 = mysql_query($sql_02);
  if (mysql_num_rows($result_02) = 0) {
  die(No releases found.);
  }
  $my_row_02 = mysql_fetch_array($result);
  $band_name = bandname;
  $albumtitle = albumtitle;
  $email = email;
  echo brbrhrbartist name with spaces from releases:/b  .
$my_row_02[$artist];
  echo brbalbum name:/b  . $my_row_02[$albumtitle];
  echo brbalbum code:/b  . $my_row_02[$albumcode];
 
  mysql_close($link);
  ?

 What do you exactly want to do?

 And what is that?

 $band = nospaces_bands;
 $band_spaces = band_bands;
 $id = id;
 $email = email;

 Why don't you do this:

 echo bband name without spaces:/b  . $my_row[band];
 echo brbband name with spaces:/b  . $my_row[band_spaces];
 echo brbid:/b  . $my_row[id];
 echo brbemail address:/b  . $my_row[email];

 Greetings

 Kobi


-- 
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: database abstraction for php3

2001-07-25 Thread Manuel Lemos

Hello,

Geoffrey Makstutis wrote:
 
 Hi,
 
 Can anyone suggest a good (and simple) database abstraction class for php3?
 
 I have been using ADODB, but it doesn't like php3.

Metabase supports PHP 3. According to this poll it seems that roughly
20% of the users still need PHP 3 support when they access to databases.

http://groups.yahoo.com/group/metabase-dev/surveys?id=639035

Metabase is a database abstraction package that supports many DBMS and
is freely available here:

http://phpclasses.UpperDesign.com/browse.html/package/20

Manuel Lemos

-- 
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: database abstraction for php3

2001-07-25 Thread Manuel Lemos

Hello,

Geoffrey Makstutis wrote:
 
 Hi,
 
 Can anyone suggest a good (and simple) database abstraction class for php3?
 
 I have been using ADODB, but it doesn't like php3.

Metabase supports PHP 3. According to this poll it seems that roughly
20% of the users still need PHP 3 support when they access to databases.

http://groups.yahoo.com/group/metabase-dev/surveys?id=639035

Metabase is a database abstraction package that supports many DBMS and
is freely available here:

http://phpclasses.UpperDesign.com/browse.html/package/20

Manuel Lemos

-- 
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] WHERE field = str

2001-07-25 Thread phpnet

I am trying to find a str within a field using a select statement like
SELECT * FROM tablename WHERE fieldname has the string within it

Is there a way to do this?
Dave


-- 
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] WHERE field = str

2001-07-25 Thread Boget, Chris

 I am trying to find a str within a field using a select statement like
 SELECT * FROM tablename WHERE fieldname has the string within it
 Is there a way to do this?

WHERE fieldname LIKE %$string%

Chris



RE: [PHP-DB] WHERE field = str

2001-07-25 Thread Boget, Chris

 I searched everything I could think of. Where should I have 
 found this is the manual?

Nowhere in the PHP manual, I think.  But you could find
info on this in the MySQL manual (or any other db server's
documentation...)

Chris



RE: [PHP-DB] WHERE field = str

2001-07-25 Thread Matthew Loff


Certainly not in the PHP manual, and LIKE isn't really covered in the
MySQL manual either...

Here's a good page with an intro to SQL queries:
http://developer.ecorp.net/sqltut.htm

--Matt


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 25, 2001 2:46 PM
To: PHP DataBase-List
Subject: Re: [PHP-DB] WHERE field = str


Thanks Chris
I searched everything I could think of. Where should I have found this
is the manual? Dave


|  I am trying to find a str within a field using a select statement 
|  like SELECT * FROM tablename WHERE fieldname has the string within 
|  it Is there a way to do this?
| 
| WHERE fieldname LIKE %$string%
| 
| Chris
| 

[EMAIL PROTECTED]

SeaPortNetHosting: Reliable Web Hosting
Plans from $17.95 www.yourname.com
http://www.SeaPortNet.com/
1(209)551-7028 

-- 
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] Re: another php/mysql problem

2001-07-25 Thread Hugh Bothwell

Couple of comments:

1.  What's with the $artist = artist; echo $mytable[$artist]; bit?
This really doesn't seem to gain you much.
2.  Descriptive variable names are a Good Thing(tm).
3.  Prettyprinting 
4.  Why are the tables in different databases to begin with?
5.  Don't pull any more than you need from the database.

Try:

?php
// expects $band as parameter

mysql_connect(localhost,username,password)
or die (Could not connect to MySQL!);

$band_result = mysql_query(
SELECT nospaces_bands, band_bands, id, email 
.FROM almavale_board.bands
.WHERE nospaces_bands = '$band' 
)
or die(Error in band query);

while ($band_row = mysql_fetch_array($band_result)) {
printBand($band_row);

$shows_result = mysql_query(
SELECT artistname, venue, time 
.FROM almavale_board.shows 
.WHERE artistname = '.$band_row[band_bands].'
)
or die(Error in show query);

while($show_row = mysql_fetch_array($show_result))
printShow($show_row);

$release_result = mysql_query(
SELECT bandname, albumtitle, email 
.FROM almavale_releases.releases 
.WHERE bandname = '.$band_row[band_bands].'
)
or die(Error in release query);

while($release_row = mysql_fetch_array($release_result))
printRelease($release_row);
}

?

... and you can implement printBand, printShow, and printRelease as you
like.



-- 
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] WHERE field = str

2001-07-25 Thread Paul DuBois

At 2:55 PM -0400 7/25/01, Matthew Loff wrote:
Certainly not in the PHP manual, and LIKE isn't really covered in the
MySQL manual either...

Of course it is.

http://www.mysql.com/doc/S/t/String_comparison_functions.html



Here's a good page with an intro to SQL queries:
http://developer.ecorp.net/sqltut.htm

--Matt


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 25, 2001 2:46 PM
To: PHP DataBase-List
Subject: Re: [PHP-DB] WHERE field = str


Thanks Chris
I searched everything I could think of. Where should I have found this
is the manual? Dave


|  I am trying to find a str within a field using a select statement
|  like SELECT * FROM tablename WHERE fieldname has the string within
|  it Is there a way to do this?
|
| WHERE fieldname LIKE %$string%
|
| Chris
|

[EMAIL PROTECTED]

SeaPortNetHosting: Reliable Web Hosting
Plans from $17.95 www.yourname.com
http://www.SeaPortNet.com/
1(209)551-7028


-- 
Paul DuBois, [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] WHERE field = str

2001-07-25 Thread Matthew Loff


Good call, Paul...

I checked through the manual briefly to see if LIKE was in there, I
guess I missed that page.  


-Original Message-
From: Paul DuBois [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 25, 2001 5:08 PM
To: Matthew Loff; [EMAIL PROTECTED]; 'PHP DataBase-List'
Subject: RE: [PHP-DB] WHERE field = str


At 2:55 PM -0400 7/25/01, Matthew Loff wrote:
Certainly not in the PHP manual, and LIKE isn't really covered in the 
MySQL manual either...

Of course it is.

http://www.mysql.com/doc/S/t/String_comparison_functions.html



Here's a good page with an intro to SQL queries: 
http://developer.ecorp.net/sqltut.htm

--Matt


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 25, 2001 2:46 PM
To: PHP DataBase-List
Subject: Re: [PHP-DB] WHERE field = str


Thanks Chris
I searched everything I could think of. Where should I have found this 
is the manual? Dave


|  I am trying to find a str within a field using a select statement 
|  like SELECT * FROM tablename WHERE fieldname has the string within 
|  it Is there a way to do this?
|
| WHERE fieldname LIKE %$string%
|
| Chris
|

[EMAIL PROTECTED]

SeaPortNetHosting: Reliable Web Hosting
Plans from $17.95 www.yourname.com
http://www.SeaPortNet.com/
1(209)551-7028


-- 
Paul DuBois, [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] oracle and informix interface

2001-07-25 Thread Sommai Fongnamthip

Hi,
I've been known that PHP could connect to oracle or informix.  But when I 
try to configure PHP, it tell me that there are some library required.  How 
could I find oracle or informix support library for PHP?

Sommai Fongnamthip


-- 
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] 'htaccess method : how to modify passwords from PHP scripts ?

2001-07-25 Thread Caleb Walker

On Tuesday 24 July 2001 10:22 am, JD Daniels wrote:
 There is a fantastic class that takes care of writing .ht* files... look
 here:

 http://phpclasses.upperdesign.com/

Couldnt find anything on writing .ht* files.  Are you sure?

-- 
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] new data detect

2001-07-25 Thread Sommai Fongnamthip

Hi,
I decide to make real time application (like stock market or online 
news).  How could I know when new data arrive to table and retrieve them to 
display or update in web page?

Sommai Fongnamthip


-- 
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] 'htaccess method : how to modify passwords from PHP scripts ?

2001-07-25 Thread Jordan

  There is a fantastic class that takes care of writing .ht* files... look
  here:
 
  http://phpclasses.upperdesign.com/
 
 Couldnt find anything on writing .ht* files.  Are you sure?

I looked and originally had trouble finding the class there too.
I think it is a mirror of a version of the following class:

http://www.thewebmasters.net/php/Htpasswd.phtml

I haven't had a chance to test it out, but I think this might be what you are looking 
for.

Cheers.

--JW


-- 
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: new data detect

2001-07-25 Thread Hugh Bothwell


Sommai Fongnamthip [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,
 I decide to make real time application (like stock market or online
 news).  How could I know when new data arrive to table and retrieve them
to
 display or update in web page?

You can't, actually, short of using server-side push;

what you can do is periodically requery the server; either reload the page
every so often, or (better) use a flag file - set it when data is changed -
and check it in the background with JavaScript, then reload the page only
when it is set.



-- 
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] report style printing

2001-07-25 Thread Sommai Fongnamthip

Hi,
When I retrieve data to display on web with PHP, it can print out from web 
in Browser Stlye.  How could we have some PHP code to retrieve current 
display data into PC and print it with some Custom Report Style?

Sommai Fongnamthip


-- 
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: PHP - MySQL

2001-07-25 Thread news.php.net

 The code should not be on the page which comes
 after clicking, but on the same page where the button is.

if this is the requirement, then look maybe use javascript



-- 
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]