Re: Re: RE: [PHP] Newbie Question
| From: | Andrey Hristov | Date: | Thu, 08 Nov 2001 17:19:56 +0000 |
| Subject: | Re: Re: RE: [PHP] Newbie Question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-73918@lists.php.net to get a copy of this message | ||
Yeap, \n is an instruction for the terminal to make CR-LF.
----- Original Message -----
From: "Jay Fitzgerald" <jayfitz@bayou.com>
To: "Oosten, Sjoerd van" <SvOosten@esites.nl>; <php-general@lists.php.net>;
<php-db@lists.php.net>; <mysql@lists.mysql.com>
Sent: Thursday, November 08, 2001 7:08 PM
Subject: [PHP] Re: [PHP-DB] RE: [PHP] Newbie Question
> Ok.....I have it working half-way now.....here is what I have so far:
>
>
> ===================
> PHP FORM ("add_jobs.php" - submits to the script below):
>
> <FORM METHOD="post" ACTION="do_addjobs.php">
> <TEXTAREA NAME="duties" COLS="30" ROWS="10"
> WRAP="virtual"></TEXTAREA>
> <INPUT TYPE="submit" VALUE="Add Job">
> </FORM>
> ===================
>
>
> ===================
> PHP SCRIPT ("do_addjobs.php" - inserts into db)
>
> <?
> if ((!$duties))
> {
> header("Location: add_jobs.php");
> exit;
> }
>
> $sql = "INSERT INTO jobs (duties) values ('$duties')";
> $connection = mysql_connect("localhost", "????", "????") or die
> ("Couldn't
> connect to the server.");
> $db = mysql_select_db("????", $connection) or die ("Couldn't select the
> database.");
> $sql_result = mysql_query($sql) or die ("Couldn't execute query.");
>
> echo "<B>Duties:";
> echo nl2br ($duties);
> echo "</B>";
>
> ?>
> ===================
>
>
>
> With the way I have this above, when it does "echo nl2br ($duties);" it
> displays fine now -- thanks for that help so far -- but the problem now
> (this may be normal, but I am not sure) is when I connect to the db and
> "select * from jobs;" the db is writing the entries like this:
>
>
> ===================
> mysql> select * from jobs;
>
> +----+----------+----------+--------+---------+---------------------------------+----------+----------+--------+----------+
> | id | position | opendate | salary | appdate |
> duties | examples | training | skills | benefits |
>
> +----+----------+----------+--------+---------+---------------------------------+----------+----------+--------+----------+
> | 1 | test | test | test | test | 1
> 2
> 3
>
> 4
> 5
> 6
>
>
> 7
> 8
> 9 | test | test | test | test |
>
> +----+----------+----------+--------+---------+---------------------------------+----------+----------+--------+----------+
> ===================
>
>
> is this in fact normal?
>
>
> Jay
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>