Jump to content

Need help echoing values


XCVIII

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/266987-need-help-echoing-values/
Share on other sites

I think you should start with the PHP manual tutorial. Then read up on PHP arrays and "mysql_fetch_array ()".

 

PS: Do note that the mysql_* () functions are deprecated, and that you should use MySQLi or PDO instead. (Read more about them in the manual.)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.