RE: [PHP-DB] textarea and mysql query

2002-03-18 Thread Hunter, Ray

Try this:

form name=wel_area method=post action=index_confirm.php3 target=box
?php
$record = mysql_fetch_array(@mysql_query(SELECT wel_area FROM
cm_index,$dbh)); 
echo textarea name='wel_area' value='.$record['wel_area'].' cols='25'
rows='8'/textareabrinput type='submit' name='save'
value='save'br\n; 
?
/form

If not then let me know...


Thank you,

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


-Original Message-
From: jas [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, March 17, 2002 11:54 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] textarea and mysql query


I need some help with a query to place the results within a text area...
here is the code and so far every time I try it out all that happens is it
displays the textbox but not the results of the query. form name=wel_area
method=post action=index_confirm.php3 target=box
?php
$record = mysql_fetch_array(@mysql_query(SELECT wel_area FROM
cm_index,$dbh)); echo textarea name='wel_area'
value='{$record['wel_area']}' cols='25' rows='8'/textareabrinput
type='submit' name='save' value='save'br\n; ?
  /form
Any help would be great.
Jas



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



Re: [PHP-DB] textarea and mysql query

2002-03-18 Thread Jason Wong

On Monday 18 March 2002 14:53, jas wrote:

 I need some help with a query to place the results within a text area...
 here is the code and so far every time I try it out all that happens is it
 displays the textbox but not the results of the query.
 form name=wel_area method=post action=index_confirm.php3
 target=box ?php
 $record = mysql_fetch_array(mysql_query(SELECT wel_area FROM
 cm_index,$dbh));
 echo textarea name='wel_area' value='{$record['wel_area']}' cols='25'
 rows='8'/textareabrinput type='submit' name='save'
 value='save'br\n;
 ?
   /form


If this is *all* your code then you're missing the important step of 
connecting to the mysql server and selecting a database.

Have a look at the examples in the manual.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Most people don't need a great deal of love nearly so much as they need
a steady supply.
*/

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




Re: [PHP-DB] textarea and mysql query

2002-03-18 Thread jas

Yeah that didn't work either... If I put the same value (
value=\{$record['wel_area']}\ ) on a text line it works just fine however
using the same value for a textarea doesnt give me any results nor does it
give me an error message to go on, if there is a way to output the code to
the screen like a dos echo command that would help out alot.  Thanks in
advance,
Jas
Ray Hunter [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Try this:

 form name=wel_area method=post action=index_confirm.php3
target=box
 ?php
 $record = mysql_fetch_array(@mysql_query(SELECT wel_area FROM
 cm_index,$dbh));
 echo textarea name='wel_area' value='.$record['wel_area'].' cols='25'
 rows='8'/textareabrinput type='submit' name='save'
 value='save'br\n;
 ?
 /form

 If not then let me know...


 Thank you,

 Ray Hunter
 Firmware Engineer

 ENTERASYS NETWORKS


 -Original Message-
 From: jas [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, March 17, 2002 11:54 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] textarea and mysql query


 I need some help with a query to place the results within a text area...
 here is the code and so far every time I try it out all that happens is it
 displays the textbox but not the results of the query. form
name=wel_area
 method=post action=index_confirm.php3 target=box
 ?php
 $record = mysql_fetch_array(@mysql_query(SELECT wel_area FROM
 cm_index,$dbh)); echo textarea name='wel_area'
 value='{$record['wel_area']}' cols='25' rows='8'/textareabrinput
 type='submit' name='save' value='save'br\n; ?
   /form
 Any help would be great.
 Jas



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




Re: [PHP-DB] textarea and mysql query

2002-03-18 Thread jas

Sorry, the connection is established already so that part works just fine.
It is getting the results of said connection \ query to appear in a textarea
vs. a text line.
Jason Wong [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 On Monday 18 March 2002 14:53, jas wrote:

  I need some help with a query to place the results within a text area...
  here is the code and so far every time I try it out all that happens is
it
  displays the textbox but not the results of the query.
  form name=wel_area method=post action=index_confirm.php3
  target=box ?php
  $record = mysql_fetch_array(@mysql_query(SELECT wel_area FROM
  cm_index,$dbh));
  echo textarea name='wel_area' value='{$record['wel_area']}' cols='25'
  rows='8'/textareabrinput type='submit' name='save'
  value='save'br\n;
  ?
/form


 If this is *all* your code then you're missing the important step of
 connecting to the mysql server and selecting a database.

 Have a look at the examples in the manual.


 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk

 /*
 Most people don't need a great deal of love nearly so much as they need
 a steady supply.
 */



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




RE: [PHP-DB] textarea and mysql query

2002-03-18 Thread Hunter, Ray

What is the result of $record['wel_area'].  If this is a multidimensional
array then you will need to access it differently...

Example:
echo $record[0][0].\n;

Try this is your text area and see if that comes out...



Thank you,

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


-Original Message-
From: jas [mailto:[EMAIL PROTECTED]] 
Sent: Monday, March 18, 2002 12:07 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] textarea and mysql query


Yeah that didn't work either... If I put the same value (
value=\{$record['wel_area']}\ ) on a text line it works just fine however
using the same value for a textarea doesnt give me any results nor does it
give me an error message to go on, if there is a way to output the code to
the screen like a dos echo command that would help out alot.  Thanks in
advance, Jas Ray Hunter [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Try this:

 form name=wel_area method=post action=index_confirm.php3
target=box
 ?php
 $record = mysql_fetch_array(@mysql_query(SELECT wel_area FROM 
 cm_index,$dbh)); echo textarea name='wel_area' 
 value='.$record['wel_area'].' cols='25' 
 rows='8'/textareabrinput type='submit' name='save' 
 value='save'br\n; ?
 /form

 If not then let me know...


 Thank you,

 Ray Hunter
 Firmware Engineer

 ENTERASYS NETWORKS


 -Original Message-
 From: jas [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, March 17, 2002 11:54 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] textarea and mysql query


 I need some help with a query to place the results within a text 
 area... here is the code and so far every time I try it out all that 
 happens is it displays the textbox but not the results of the query. 
 form
name=wel_area
 method=post action=index_confirm.php3 target=box
 ?php
 $record = mysql_fetch_array(@mysql_query(SELECT wel_area FROM 
 cm_index,$dbh)); echo textarea name='wel_area' 
 value='{$record['wel_area']}' cols='25' rows='8'/textareabrinput 
 type='submit' name='save' value='save'br\n; ?
   /form
 Any help would be great.
 Jas



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



Re: [PHP-DB] textarea and mysql query

2002-03-18 Thread jas

Yeah it is not multidimensional at all, a simple text blob is what should be
pulled into the textarea.  I am not trying to query multipled record fields
at all.  One field per textarea.  Do you know of a good tutorial on pulling
sql queries into textareas?  If you do please let me know as I have searched
php.net and other sites for a tutorial on textarea's but have not found any
nor is there any reference to such a problem in any of the php or mysql
books i have.
Ray Hunter [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 What is the result of $record['wel_area'].  If this is a multidimensional
 array then you will need to access it differently...

 Example:
 echo $record[0][0].\n;

 Try this is your text area and see if that comes out...



 Thank you,

 Ray Hunter
 Firmware Engineer

 ENTERASYS NETWORKS


 -Original Message-
 From: jas [mailto:[EMAIL PROTECTED]]
 Sent: Monday, March 18, 2002 12:07 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] textarea and mysql query


 Yeah that didn't work either... If I put the same value (
 value=\{$record['wel_area']}\ ) on a text line it works just fine
however
 using the same value for a textarea doesnt give me any results nor does it
 give me an error message to go on, if there is a way to output the code to
 the screen like a dos echo command that would help out alot.  Thanks in
 advance, Jas Ray Hunter [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Try this:
 
  form name=wel_area method=post action=index_confirm.php3
 target=box
  ?php
  $record = mysql_fetch_array(@mysql_query(SELECT wel_area FROM
  cm_index,$dbh)); echo textarea name='wel_area'
  value='.$record['wel_area'].' cols='25'
  rows='8'/textareabrinput type='submit' name='save'
  value='save'br\n; ?
  /form
 
  If not then let me know...
 
 
  Thank you,
 
  Ray Hunter
  Firmware Engineer
 
  ENTERASYS NETWORKS
 
 
  -Original Message-
  From: jas [mailto:[EMAIL PROTECTED]]
  Sent: Sunday, March 17, 2002 11:54 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] textarea and mysql query
 
 
  I need some help with a query to place the results within a text
  area... here is the code and so far every time I try it out all that
  happens is it displays the textbox but not the results of the query.
  form
 name=wel_area
  method=post action=index_confirm.php3 target=box
  ?php
  $record = mysql_fetch_array(@mysql_query(SELECT wel_area FROM
  cm_index,$dbh)); echo textarea name='wel_area'
  value='{$record['wel_area']}' cols='25' rows='8'/textareabrinput
  type='submit' name='save' value='save'br\n; ?
/form
  Any help would be great.
  Jas
 
 
 
  --
  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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] textarea and mysql query

2002-03-18 Thread John Hughes

jas [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I need some help with a query to place the results within a text area...
 here is the code and so far every time I try it out all that happens is it
 displays the textbox but not the results of the query.
 form name=wel_area method=post action=index_confirm.php3
target=box
 ?php
 $record = mysql_fetch_array(@mysql_query(SELECT wel_area FROM
 cm_index,$dbh));
 echo textarea name='wel_area' value='{$record['wel_area']}' cols='25'
 rows='8'/textareabrinput type='submit' name='save'
 value='save'br\n;
 ?
   /form
 Any help would be great.
 Jas



If the wel_area is a TEXT field in the database, why the array treatment.
I have a database that contains several TEXT fields that I can call up and
edit.  To do that I bring the data into a textarea.

Here's part of my code:

The SQL query:

$sql = SELECT subj, body, info, fname, lname, title, city, other,
  record_date, status, batch, modified_by
  FROM $table_name
  WHERE id = '$id'
  ;

The results are read into variables:

while ($row = mysql_fetch_array($result)) {
  $subj = $row['subj'];
  $body = $row['body'];
  $info = $row['info'];
  $fname = $row['fname'];
  $lname = $row['lname'];
  $title = $row['title'];
  $city = $row['city'];
  $other = $row['other'];
  $record_date = $row['record_date'];
  $status = $row['status'];
  $batch = $row['batch'];
  $modified_by = $row['modified_by'];
 } #end while

In the body of the HTML section I have areas such as this:

td
  textarea cols=60 rows=20 name=body wrap=soft ? echo $body;
?/textarea
 /td

This creates an editable TEXTAREA that can then be UPDATEd in the database.

John Hughes



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




Re: [PHP-DB] textarea and mysql query

2002-03-18 Thread Jason Wong

On Monday 18 March 2002 15:09, jas wrote:
 Sorry, the connection is established already so that part works just fine.
 It is getting the results of said connection \ query to appear in a
 textarea vs. a text line.
 Jason Wong [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]...

  On Monday 18 March 2002 14:53, jas wrote:
   I need some help with a query to place the results within a text
   area... here is the code and so far every time I try it out all that
   happens is

 it

   displays the textbox but not the results of the query.
   form name=wel_area method=post action=index_confirm.php3
   target=box ?php

action=index_confirm.php3

Note the closing double-quote.



   $record = mysql_fetch_array(@mysql_query(SELECT wel_area FROM
   cm_index,$dbh));
   echo textarea name='wel_area' value='{$record['wel_area']}' cols='25'
   rows='8'/textareabrinput type='submit' name='save'
   value='save'br\n;
   ?
 /form



Text areas are specified as:

 textarea name=abcStuff which goes into text area/textarea


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Let's not complicate our relationship by trying to communicate with each 
other.
*/

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




RE: [PHP-DB] textarea and mysql query

2002-03-18 Thread Shrock, Court

You problem lies in the html that you are outputting.

For normal html input tags, you use the value attribute to initialize
the default display.  For textarea tags, you do not use the value
attribute; instead, enclose what you want displayed between the openining
textarea tag and the closing /textarea tag.  For example:

input type=text valuePlease edit this textbox
textareaPlease edit this textarea/textarea


 -Original Message-
 From: jas [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, March 17, 2002 10:54 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] textarea and mysql query
 
 
 I need some help with a query to place the results within a 
 text area...
 here is the code and so far every time I try it out all that 
 happens is it
 displays the textbox but not the results of the query.
 form name=wel_area method=post 
 action=index_confirm.php3 target=box
 ?php
 $record = mysql_fetch_array(@mysql_query(SELECT wel_area FROM
 cm_index,$dbh));
 echo textarea name='wel_area' value='{$record['wel_area']}' 
 cols='25'
 rows='8'/textareabrinput type='submit' name='save'
 value='save'br\n;
 ?
   /form
 Any help would be great.
 Jas
 
 
 
 -- 
 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