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

Solve the problem of php output form

PHPz
PHPzforward
2024-01-05 23:26:13586browse

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!

Statement:
This article is reproduced at:docexcel.net. If there is any infringement, please contact admin@php.cn delete