Home > Software Tutorial > Office Software > Solve the problem of php output form

Solve the problem of php output form

PHPz
Release: 2024-01-05 23:26:13
forward
637 people have browsed it

php output form problem!

Try the following:

suject:

In order to help players who have not passed the level yet, let us learn about the specific puzzle solving methods. In the code, a while loop is used to get the mysql query results and store them in the $row variable. This loop continues until there are no more results. This way we can process the query results one by one.

{

?>

}

?>

score:

Tips: Your PHP writing is not standardized and cannot be instantiated if you use an array

Please teach PHP how to loop the output form

In this case, try to use floating divs. Using table is more troublesome, the code is as follows:

PHP code

$sql = "xxx limit 40";

$query = mysql_db_query($sql);

if(mysql_num_rows($query) > 0){

?>

$ct = 0;

$cols = 8;

while($rs = mysql_fetch_array($query)){

//Output the beginning of the line

if( $ct % $cols == 0 ){

echo '

';

}

?>

$ct;

//Output line tail

if( $ct % $cols == 0 ){

echo '

';

}

}

//There are not enough cells, complete the cells and the end of the line

if( $ct % $cols != 0 ){

$lack = ($cols - $ct % $cols);

for($i = 0; $i

echo '

';

}

echo '';

}

?>

Record

}

?>

The above is the detailed content of Solve the problem of php output form. For more information, please follow other related articles on the PHP Chinese website!

source:docexcel.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template