Need help echoing values

I have created a form that outputs information to my mysql data.

For example if I enter a value in a text field the value gets sent to the database and is stored as $example=“value”

There is a populated list and its set up like this:

<?php $example1="value1"; $example2="value2"; $example3="value3"; $example4="value4"; $example5="value5"; $example6="value6"; ?>

So far everything is working, I am able to store information in the database.

However when I try to echo the information in my page it doesn’t come up at all, its blank.

I can however echo the whole table but then it comes up like this:

<?php $example1="value1"; $example2="value2"; $example3="value3"; $example4="value4"; $example5="value5"; $example6="value6"; ?>

I need to echo the values separately in a text, e.g.

This is an example $example1 and this is what $example2 I need,
I need to echo $example3 the values individually $example 4 etc $example5

I don’t know what I’m doing wrong, echoing the whole table works with:

$zeile=mysql_fetch_array($ger);
echo("\n".$seile[‘code’]."\n");

But id like to do it separately.

if you are echoing in browser you should use “
” instead of \n

No, I’m echoing in a .php file.

Using \n works for echoing the whole table.

yea but what i mean is after u echo on ur php file it will be displayed on the browser as html so you should use

maybe i didnt understand your question. what do you mean by echo values “separately”? do you mean echo values line by line?

Yes, exactly.

yeah then use

for example
[php]

<?php echo "Example1
"; echo "Example2
"; echo "Example3
"; echo "Example4
"; ?>

[/php]
this will output

echo Example1
echo Example2
echo Example3
echo Example4

Even if it is stored in the database? Shouldn’t it be echo “$example1
”; then?

you are right.

echo the content of $example1 variable and start a new line.
[php]
echo “$example1
”;
[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service