Hello all. working on getting a good understanding of php
just created a database & simple poll connection on my godaddy acct (if you want to also refer me to better hosts who have 24hrs phone svc simple wp install feel free)
so anyway…
the database connection is sound…but when i went to test retrieving data nothing is retrieved. @ http://www.danielamorescalchi.com/db_test/testConn.php
but i see nothign wrong in the code. using same dbase con & table for http://www.danielamorescalchi.com/db_test/poll01.php
and while the database is sound it can’t update the vote.
Could you please advs?
Thank you
D
Looks like your query is working but there are issues with the formatting. Viewing the source you can see content is not in the <body> tags. A number of quotes are escaped that shouldn’t be, e.g. \" and </form> tag inside table etc. Can’t really address any “Update the vote” as POST processing code is not shown. Fix code first then deal with processing.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
connected to the database
<table><tr><td><b>Results:</b><table>
<tr><td>-1</td><td>Snow...ho soooo pretty</td></tr>
<tr><td>-1</td><td>White, cold, hell</td></tr>
<tr><td>-1</td><td>thank God its over</td></tr>
<tr><td>-1</td><td>Saw a Yeti!!!</td></tr>
<tr><td>-1</td><td>Hated it so dam much</td></tr>
<tr><td>-1</td><td>whatever</td></tr></table></td><td><b>What did you think of this recent snow event?</b><form method=\\"post\\" action=\\"\\" ><table border=\\"0\\" /><tr><td><label><input type='radio' name=\\"poll\\" value=\\"0"\\ />Snow...ho soooo pretty</label></tr></td><tr><td><label><input type='radio' name=\\"poll\\" value=\\"1"\\ />White, cold, hell</label></tr></td><tr><td><label><input type='radio' name=\\"poll\\" value=\\"2"\\ />RAD, fun I loved it</label></tr></td><tr><td><label><input type='radio' name=\\"poll\\" value=\\"3"\\ />thank God its over</label></tr></td><tr><td><label><input type='radio' name=\\"poll\\" value=\\"4"\\ />Saw a Yeti!!!</label></tr></td><tr><td><label><input type='radio' name=\\"poll\\" value=\\"5"\\ />Hated it so dam much</label></tr></td><tr><td><label><input type='radio' name=\\"poll\\" value=\\"6"\\ />whatever</label></tr></td></table> <input type='submit' name='submit' value=' cast your vote' /></form></td></td></table><html>
<head>
<title>poll 01</title>
</head>
<body>
</body>
</html>
</body>
</html>
Never mind…much embarrassment. just got it two work w/my second table.
after i inserted values in the new table they showed up…http://www.danielamorescalchi.com/db_test/testConn.php
apologies…i thought i would get the table fields even if they were empty, just the titles…evidently not. Sorry have used wp but had not actually conncted and created my own db outside of some basic localhost.
Thank you though!