
- You are not logged in. | Login
January 19, 2007 12:11 pm
- monkeydude
- Member


Info output
Poll table has two columns - ask and answer
Answer column has the following values:
answe1
answer2
answer3
When execute that code
$mysqlanswer3=mysql_query("SELECT * from Poll");
while($row=mysql_fetch_row($mysqlanswer3))
{
unset($row[0]);
$row[1]=rtrim($row[1]);
$row[1]=ltrim($row[1]);
$row=implode(" ",$row);
print $row;
print ' <input type=radio name=p><br>';
}the result is:
<input type=radio name=p><br>answer1 <input type=radio name=p><br>answer2 <input type=radio name=p><br>answer3 <input type=radio name=p><br>
Last edited by monkeydude (January 19, 2007 12:13 pm)
January 19, 2007 12:17 pm
- phppat
- Member


Re: Info output
I have two questions:
1. The main one: How many line does Poll table have?
2. What does it mean?
$row[1]=rtrim($row[1]);
$row[1]=ltrim($row[1]);
$row=implode(" ",$row);
????
PHP monster
January 19, 2007 2:36 pm
- phppat
- Member


Re: Info output
1) I can't understand
If table Poll has one line how we can have 4 <input type=radio name=p>?
2) How can we change the construction to foreach and what for?
PHP monster
January 23, 2007 8:13 am
- reetesh
- Member


Re: Info output
Column ask has value "question"
Column answer "answer1 answer2 answer3"
One line
January 23, 2007 9:16 am
- phppat
- Member


Re: Info output
Please
Learn how to work with the database, find out what does script you gave do:
$newsSQL="CREATE TABLE Poll (ask TEXT,answer TEXT)";
...
$add="INSERT Poll(answer)VALUES('$_POST[$i]')"; /
$addm=mysql_query($add);
}After that we'll keep on
PHP monster


