[PHP-DB] Q

2004-08-22 Thread Remember14a
Dear Friends,

Data in the table is displayed by php query.

.Say column A, in which name of company will be stored.

Now i want to add another column B to table in which web addresse will be 
stored against each name in Column B.and same should be displayed in an html  
table, when seen in browser with link to each web address in table.

The php query I am using now, is posted below.
What additional code should I add so that data in column A in table1 is 
displayed in tabular form, with a link on click, to web address in column B.

Guidance to further Query, please.


Present Query


?php
// open the connection
$conn = mysql_connect(localhost, , );

// pick the database to use
mysql_select_db(b,$conn);

// create the SQL statement
$sql = SELECT * FROM subscribers ORDER BY email;

// execute the SQL statement
$result = mysql_query($sql, $conn) or die(mysql_error());

//go through each row in the result set and display data
while ($newArray = mysql_fetch_array($result)) {
// give a name to the fields
$id  = $newArray['id'];
$email = $newArray['email'];
//echo the results onscreen between can also //type$id is and email is
echo  $email br;
}
?center


Re: [PHP-DB] Q

2004-08-22 Thread Doug Thompson
[EMAIL PROTECTED] wrote:
Dear Friends,
Data in the table is displayed by php query.
.Say column A, in which name of company will be stored.
Now i want to add another column B to table in which web addresse will be 
stored against each name in Column B.and same should be displayed in an html  
table, when seen in browser with link to each web address in table.

The php query I am using now, is posted below.
What additional code should I add so that data in column A in table1 is 
displayed in tabular form, with a link on click, to web address in column B.

Guidance to further Query, please.

Present Query

?php
// open the connection
$conn = mysql_connect(localhost, , );
// pick the database to use
mysql_select_db(b,$conn);
// create the SQL statement
$sql = SELECT * FROM subscribers ORDER BY email;
// execute the SQL statement
$result = mysql_query($sql, $conn) or die(mysql_error());
//go through each row in the result set and display data
while ($newArray = mysql_fetch_array($result)) {
// give a name to the fields
$id  = $newArray['id'];
$email = $newArray['email'];
//echo the results onscreen between can also //type$id is and email is
echo  $email br;
}
?center
http://dev.mysql.com/doc/mysql/en/ALTER_TABLE.html
D
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Fwd: [PHP-DB] Q

2004-08-22 Thread Remember14a


Dear friends,

Php query modification, guidance, please.not mysql alteration table.So thatQuery displays data in tabular form with "Onclick" link to web site in another column of table.

Guidance, please.
---BeginMessage---
[EMAIL PROTECTED] wrote:
Dear Friends,
Data in the table is displayed by php query.
.Say column A, in which name of company will be stored.
Now i want to add another column B to table in which web addresse will be 
stored against each name in Column B.and same should be displayed in an html  
table, when seen in browser with link to each web address in table.

The php query I am using now, is posted below.
What additional code should I add so that data in column A in table1 is 
displayed in tabular form, with a link on click, to web address in column B.

Guidance to further Query, please.

Present Query

?php
// open the connection
$conn = mysql_connect(localhost, , );
// pick the database to use
mysql_select_db(b,$conn);
// create the SQL statement
$sql = SELECT * FROM subscribers ORDER BY email;
// execute the SQL statement
$result = mysql_query($sql, $conn) or die(mysql_error());
//go through each row in the result set and display data
while ($newArray = mysql_fetch_array($result)) {
// give a name to the fields
$id  = $newArray['id'];
$email = $newArray['email'];
//echo the results onscreen between can also //type$id is and email is
echo  $email br;
}
?center
http://dev.mysql.com/doc/mysql/en/ALTER_TABLE.html
D
---End Message---
-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Fwd: [PHP-DB] Q

2004-08-22 Thread Peter Ellis
Try using 0 and 1 in place of 'id' and 'email', depending on the order
in which these are presented in the database.  If the database presents
id first, then id is 0.  If email is first, email is 0.  You should
really read the PHP manuals on mysql_fetch_array() before assuming a
particular behavior from that function.  By default, mysql_fetch_array
gives you an array with *numerical* indices, not indices with field
names.

If you're having trouble outputting an array, you can (and should)
always do a print_r($array) to see what the index and actual values are.
-- 
Peter Ellis - [EMAIL PROTECTED]
Web Design and Development Consultant
naturalaxis | http://www.naturalaxis.com/

On Sun, 2004-08-22 at 11:10 -0400, [EMAIL PROTECTED] wrote:
 Dear friends,
  
 Php query modification, guidance, please.not mysql alteration table.So
 that Query displays data in tabular form with Onclick link to web
 site in another column of table.
  
 Guidance, please.
 Email message/mailbox attachment
 On Sun, 2004-08-22 at 11:10 -0400, [EMAIL PROTECTED] wrote:
  [EMAIL PROTECTED] wrote:
   Dear Friends,
   
   Data in the table is displayed by php query.
   
   .Say column A, in which name of company will be stored.
   
   Now i want to add another column B to table in which web addresse will be 
   stored against each name in Column B.and same should be displayed in an html  
   table, when seen in browser with link to each web address in table.
   
   The php query I am using now, is posted below.
   What additional code should I add so that data in column A in table1 is 
   displayed in tabular form, with a link on click, to web address in column B.
   
   Guidance to further Query, please.
   
   
   Present Query
   
   
   ?php
   // open the connection
   $conn = mysql_connect(localhost, , );
   
   // pick the database to use
   mysql_select_db(b,$conn);
   
   // create the SQL statement
   $sql = SELECT * FROM subscribers ORDER BY email;
   
   // execute the SQL statement
   $result = mysql_query($sql, $conn) or die(mysql_error());
   
   //go through each row in the result set and display data
   while ($newArray = mysql_fetch_array($result)) {
   // give a name to the fields
   $id  = $newArray['id'];
   $email = $newArray['email'];
   //echo the results onscreen between can also //type$id is and email is
   echo  $email br;
   }
   ?center

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



FW: Fwd: [PHP-DB] Q

2004-08-22 Thread Darryl
I think he wants something like;

Echo(a href=\$address\view website/a\n);

Where $address = the db entry that will store the value

-Original Message-
From: Peter Ellis [mailto:[EMAIL PROTECTED] 
Sent: Sunday, August 22, 2004 6:57 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: Fwd: [PHP-DB] Q

Try using 0 and 1 in place of 'id' and 'email', depending on the order
in which these are presented in the database.  If the database presents
id first, then id is 0.  If email is first, email is 0.  You should
really read the PHP manuals on mysql_fetch_array() before assuming a
particular behavior from that function.  By default, mysql_fetch_array
gives you an array with *numerical* indices, not indices with field
names.

If you're having trouble outputting an array, you can (and should)
always do a print_r($array) to see what the index and actual values are.
-- 
Peter Ellis - [EMAIL PROTECTED]
Web Design and Development Consultant
naturalaxis | http://www.naturalaxis.com/

On Sun, 2004-08-22 at 11:10 -0400, [EMAIL PROTECTED] wrote:
 Dear friends,
  
 Php query modification, guidance, please.not mysql alteration table.So
 that Query displays data in tabular form with Onclick link to web
 site in another column of table.
  
 Guidance, please.
 Email message/mailbox attachment
 On Sun, 2004-08-22 at 11:10 -0400, [EMAIL PROTECTED] wrote:
  [EMAIL PROTECTED] wrote:
   Dear Friends,
   
   Data in the table is displayed by php query.
   
   .Say column A, in which name of company will be stored.
   
   Now i want to add another column B to table in which web addresse will
be 
   stored against each name in Column B.and same should be displayed in
an html  
   table, when seen in browser with link to each web address in table.
   
   The php query I am using now, is posted below.
   What additional code should I add so that data in column A in table1
is 
   displayed in tabular form, with a link on click, to web address in
column B.
   
   Guidance to further Query, please.
   
   
   Present Query
   
   
   ?php
   // open the connection
   $conn = mysql_connect(localhost, , );
   
   // pick the database to use
   mysql_select_db(b,$conn);
   
   // create the SQL statement
   $sql = SELECT * FROM subscribers ORDER BY email;
   
   // execute the SQL statement
   $result = mysql_query($sql, $conn) or die(mysql_error());
   
   //go through each row in the result set and display data
   while ($newArray = mysql_fetch_array($result)) {
   // give a name to the fields
   $id  = $newArray['id'];
   $email = $newArray['email'];
   //echo the results onscreen between can also //type$id is and
email is
   echo  $email br;
   }
   ?center

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

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



[PHP-DB] Q

2004-02-22 Thread Remember14a
Dear friends,
How do I enable the same.Comments, please


You don't have permission to access /$_SERVER[PHP_SELF]/ on this server.


[PHP-DB] Q

2004-02-22 Thread Remember14a
Dear friends,

I have pap4, mysql, apache installed. How do I enable to access
 /$_SERVER[PHP_SELF]/
.Comments, please

I  getting folloing error
You don't have permission to access /$_SERVER[PHP_SELF]/ on this server.


Re: [PHP-DB] Q

2004-02-22 Thread Doug Thompson

On Sun, 22 Feb 2004 11:02:29 EST, [EMAIL PROTECTED] wrote:

Dear friends,

I have pap4, mysql, apache installed. How do I enable to access
 /$_SERVER[PHP_SELF]/
.Comments, please

Correct your syntax errors:

\$_SERVER['PHP_SELF']\


Doug

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



[PHP-DB] [Q] EXT SQL IN PostgreSQL

2002-06-21 Thread brown

# Sorry to my poor English

I have a procedure ( named by select_table )

##
BEGIN;
select select_table('select_cur','table_name');
FETCH ALL IN select_cur;
COMMIT;
##

This Query is right In Console (psql).

I wanna see a result with php.

$sql = 
BEGIN;
select select_table('select_cur','table_name');
FETCH ALL IN select_cur;
COMMIT;
;
$result = pg_exec($connect,$sql);
$row = pg_fetch_row($result);

is not run.

How can I get the CURSOR from PostgreSQL with PHP ?










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




[PHP-DB] Q regarding recursive function

2001-12-06 Thread Bart Verbeek

Hello,

I'm using the following function:
BEGIN CODE
$q_cat =SELECT cat_id, cat_naam, cat_parent_id FROM cat;
$r_cat = mysql_query($q_cat) or die (Invalid Query fout Q=cat);
if ($r_cat)


$n=0;
if (mysql_num_rows($r_cat)  0)


while ($row_cat = mysql_fetch_array($r_cat))


$item[$row_cat[cat_id]][naam] = $row_cat[cat_naam];
$item[$row_cat[cat_id]][id] = $row_cat[cat_id];
$kidsof[$row_cat[cat_parent_id]][] = $row_cat[cat_id];
  }
  }
  }

#CAT-FUNCTIE
function print_tree($id=0,$spatie=0,$sid)


global $kidsof;
global $item;
global $sid;
$j=0;
while ($j  $spatie)


echo nbsp;nbsp;;
$j++;
  }
$i=0;
$spatie++;
print (a href='show_cat.php?sid=.$sid.cat_id=.$item[$id][id].'
target=\inhoud\.$item[$id][naam]./abr\n);
while ($i  count($kidsof[$id]))


print_tree($kidsof[$id][$i],$spatie,$sid);
$i++;
  }
  }

print_tree();
END CODE

It prints the tree of categories with all childs under the parent categories
with there parents.

But when I call the function with $id=5 (I want the categorie-tree of cat 5
and children) nothing happens.
How can I change the function so the cat-tree for $id=$var1 will be shown??


Kind regards,

Bart



-- 
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] [Q] MS-SQL Print Statements.....

2001-08-14 Thread Donovan J. Edye

G'Day,

My environment is as follows:

- MS-SQL 2k on Win32 box
- PHP 4.xx, TDS x.xx on Linux box

If I have the following stored procedure:

CREATE PROCEDURE MyProc AS
BEGIN
PRINT 'Hello World'
SELECT * FROM tblMyTable
END
GO

And I am using the mssq_* functions. How do I get to see any PRINT 
statements from the stored procedure.

TIA


-- Donovan
--
Donovan J. Edye [www.edye.wattle.id.au]
Namadgi Systems [www.namsys.com.au]
Voice: +61 2 6285-3460
Fax: +61 2 6285-3459
TVisualBasic = Class(None);
Heard just before the 'Big Bang': ...Uh Oh
--
GXExplorer [http://www.gxexplorer.org] Freeware Windows Explorer
replacement. Also includes freeware delphi windows explorer components.
--



[PHP-DB] [Q] PHP on Linux, Oracle on Win32

2001-08-01 Thread Donovan J. Edye

G'Day All,

I need to establish connectivity between a Debain Linux box running PHP 
4.06 and Oracle 8i running on a Win32 box. Can someone point me at some 
FAQ's or other help. At present I have managed to get MS-SQL 2K going using 
TDS (Tabular Data Stream). Could TDS also be used for Oracle?

TIA


-- Donovan
--
Donovan J. Edye [www.edye.wattle.id.au]
Namadgi Systems [www.namsys.com.au]
Voice: +61 2 6285-3460
Fax: +61 2 6285-3459
TVisualBasic = Class(None);
Heard just before the 'Big Bang': ...Uh Oh
--
GXExplorer [http://www.gxexplorer.org] Freeware Windows Explorer
replacement. Also includes freeware delphi windows explorer components.
--