Up vote -2 down vote favorite share g+ share fb share tw.
I have a php page displaying data from a mysql database, based on a dropdown list selection, also from a mysql database. This obviously makes use of a Java Script. The php and mysql integration is working perfectly however I need to change the way the data is displayed.
Currently the returned mysql data is displaying in one table cell, I want each returned mysql field to be displayed in its own table cell. I have added a photo of the output, I want it to display in each table cell, not in one. I have attached the code from both my php file and the php file querying the database.
Any assistance would be greatly appreciated! Index. Php ".
$sku; }? > SKU Description SU Points Category Grouping SKU Details will be seen here getdata page " . $row'Description' .
""; echo "" . $row'SellingUnits' . ""; echo "" .
$row'EOTTPoints' . ""; echo "" . $row'Category' .
""; echo "" . $row'Grouping' . ""; } mysql_close($con);?
> php javascript mysql table link|improve this question edited Jan 13 at 8:49AVD32k41842 asked Jan 13 at 8:39Ryan Smith2247 76% accept rate.
1 hi I had to retag java into javascript – ianace Jan 13 at 8:48 Welcome to Stack Overflow! SO is not meant to be a "write my code for me" site - if that's what you are looking for, you should probably hire an expert to do it for you. If you have a specific technical question arising of your working on the issue, feel free to edit the question accordingly.
– Pekka Jan 13 at 8:51 I am 100% with you in that its not a write it for me site. I have written this code in the question based on examples I found on the net. It is working well I am just having one issue which I cant get working, hence my question.
I have done the research! – Ryan Smith Jan 13 at 9:15.
The problem here is that you've used two ideas that don't quite work together. This line: document. GetElementById("txtHint").
InnerHTML=xmlhttp. ResponseText; is setting the content of the tag with id "txtHint" to what your php script returns. This means that when your php returns, for example: blahblahblah then your page ends up with: blah blah blah Do you see what's happening here?
You aren't adding more cells to the existing row, you're creating another table within the cell you already have (and a bad one at that, with no or tags...). To get around this, change the element with id "txtHint" to the tag for the row you are editing, and update the php to return the first cell of that row as well, eg: HTML: SKU Description SU Points Category Grouping SKU Details will be seen here PHP: while($row = mysql_fetch_array($result)) { echo ""; echo $optionssku; //Not sure where this variable comes from, so I'll leave getting it from wherever necessary to you echo ""; echo "" . $row'Description' .
""; echo "" . $row'SellingUnits' . ""; echo "" .
$row'EOTTPoints' . ""; echo "" . $row'Category' .
""; echo "" . $row'Grouping' . ""; } (code not tested, but it'll be something like this).
There are certainly other methods to get around this problem, almost certainly better ones, but this is the first idea that came to me.
Thanks a million! – Ryan Smith Jan 13 at 20:54.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.