How to write html inside php <li onClick=
How to write html inside php
function foo() { echo ''; foreach ($result as $value) //while ($row = mysql_fetch_array($result)) { echo '- ' .$value["university_tuitor"]. '
'; } echo '
'; } } echo '' .$value["university_tuitor"]. ' ';
unable to call ocClick function please help me out guys
Answer by Mike for How to write html inside php
Your code contained formatting errors. I fixed it up a bit. The following will work if you pass the result set as the first parameter to the function foo.
function foo($result){ echo ''; foreach ($result as $value){ echo '- '.$value["university_tutor"].'
'; } echo '
'; }
If "onClick" doesn't fire in your browser, then try "onclick" instead. Some browsers tend to have bugs. I also corrected the spelling mistake of the word tutor (you had tuitor).
Answer by Ameer Hamza for How to write html inside php
Brother there is some code logical error...
function foo() { echo ''; foreach ($result as $value) //while ($row = mysql_fetch_array($result)) { echo '- ' .$value["university_tuitor"]. '
'; } echo '
'; }
Answer by XeBii for How to write html inside php
Just fixed the HTML part.
echo '' .$value["university_tuitor"]. ' ';
You should use an IDE or something that highlights syntax errors.
i recommend PHPStorm
Answer by Waqas Shahid for How to write html inside php
Try using IDE, it will highlight syntax errors on the go...
function foo() { echo ''; foreach ($result as $value) { echo '- ' .$value["university_tuitor"]. '
'; } echo '
'; } }
Answer by Amir for How to write html inside php
Whats the error you're getting?
First: there is a trailing curly bracket in your script before the last echo.
Second: I have re-written the script and it should work so far every other part of your script is OK.
function foo(){ echo ''; foreach ($result as $value){ //while ($row = mysql_fetch_array($result)) echo "- ".$value['university_tuitor']."
"; } echo '
'; } echo "".$value['university_tuitor']." ";
Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72
0 comments:
Post a Comment