Re: [PHP-DB] Gathering data from a database

2003-03-22 Thread Adam -
Hi,

   $select = "mysql_select_db ($database)"; << like Mike said you don't 
need to have this in " and no need for a var to be assigned...

  Then when you want to print out the data

print_r( $row );

you can use $row['table_row_name'];
:)
Adam
At 08:26 PM 3/22/2003 -0500, you wrote:
I have been having this problem for a while now, and I cant figure it out. 
the code is:

$host = "localhost";
$uname = "sniper";
$pass = "starcraft";
$database = "sha";
$tablename = "members";
$connect = mysql_connect ($host, $uname, $pass);
$select = "mysql_select_db ($database)";
$query = "SELECT * from $tablename";
$result = mysql_query ($query, $connect);

while ($row = mysql_fetch_array($result))
{
print_r( $row );
echo mysql_error();
}
?>
mysql has an error on line 19. Line 19 is while ($row = 
mysql_fetch_array($result)). What am I doing wrong?

Thanks for your help,
Mike


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Gathering data from a database

2003-03-22 Thread Paul Burney
on 3/22/03 8:26 PM, Mike Delorme at [EMAIL PROTECTED] appended the
following bits to my mbox:

> $select = "mysql_select_db ($database)";

Remove the quotes around this.  Actually, there is no reason to do the
variable assignment either.

Sincerely,

Paul Burney






-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: Solidarity with the World View

2003-03-22 Thread Richard Stallman
Part of the definition of free software is that the user is free to
use it for any purpose.  If there is a restriction about what jobs it
can be used for, the software is not free.  I am thinking of writing
an article about why it should be this way.  I will do so if I have time.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Gathering data from a database

2003-03-22 Thread Mike Delorme
I have been having this problem for a while now, and I cant figure it out. the code is:


mysql has an error on line 19. Line 19 is while ($row = mysql_fetch_array($result)). 
What am I doing wrong?


Thanks for your help,
Mike

[PHP-DB] traverse an array while assigning to Incrementing variable labels

2003-03-22 Thread [EMAIL PROTECTED]
I get this error when I use $i=0; in multiple functions to create a while
loop: 

Fatal error: Only variables can be passed by reference

I need to:
 increment variable labels
 use the value of "i" to iterate through arrays using a while loop.

How do I do this?

/T  



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: Cross-Table

2003-03-22 Thread John Lim
Hi

The ADOdb db abstraction library has support for cross-tables (pivot
tables).

http://php.weblogs.com/adodb

"Blain" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Does anyone have some experience with cross-tables?
>
> Thanks for help
>
> Blain
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] combination of fetch_field and fetch_row

2003-03-22 Thread gert vonck
hey everyone,

i want to get this result :

--
| Boss (--> field name) | Mr. Blabla |
| Street| Oxford str.|
   ...   ...
I did this with :

$result0 = mysql_query("SELECT 
uitbater,straatnaam,postcode,gemeente,provincie,telefoon,fax,email FROM 
info_general") or die (mysql_error());

$get_info0 = mysql_fetch_row($result0);

$i = 0;
while ($i < mysql_num_fields($result0))
{
		$meta = mysql_fetch_field($result0);

foreach ($get_info0 as $field0)
{
print "\t$meta->name$field0\n";
}
$i++;
	}

He doesn't give an error, but he only prints 8 times the 2nd column and 
nothing in the first (field name column)

Does anyone know how to solve this?

Greetz,

Gert Vonck



_
Chat with your online buddies with MSN Messenger http://messenger.msn.be
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] SSL Implementation

2003-03-22 Thread Buics
good day!

anyone knows how to implement HTTPs in PHP?
is it possible if i will use OpenSSL?

TIA,
buics


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php