• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 434
  • Last Modified:

Ajax php/mysql reply into html table

Hi Guys,

I'm working in a php/mysql environment. I have a page where I enter a zip code and using ajax it should display the salesman's name and phone.

in my php file I am sending the results back using:

 echo "<tr>";
 echo  "<td>". $row->Name ."</td></tr>";
 echo  "<tr><td>".$ row->Cell_Phone ."</td></tr>";

when I get it back from the php file I am inserting it into a div with an id=Nametxt, and into a text field  id=Email  using:



The div shows:                Dave Brown888-452-7899

The text field shows this:         <td>Dave Brown</td></tr><tr><td>888-452-7899</td></tr>

Why doesn't the table show correctly in the div?

I want it to be:                Dave Brown
  • 2
1 Solution
Dave BaldwinFixer of ProblemsCommented:
"<td>Dave Brown</td></tr><tr><td>888-452-7899</td></tr>" is not a complete table therefore it won't format like one.  This is the minimum you need.
<table><tr><td>Dave Brown</td></tr><tr><td>888-452-7899</td></tr></table>

Open in new window

jws2bayAuthor Commented:
Man...I hate tripping over the obvious.   It works.

Thanks for the help

Have a great day
Dave BaldwinFixer of ProblemsCommented:
You're welcome, glad to help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now