Jump to content

Recommended Posts

This code is copying the data from the previous query for some reason, and changing the type of field produced:

 

<?php

$type=$_GET[type];

?>

<form action="?page=construction_type&type=<?php echo $type;?>" method="post">

<strong>Zip/Postal Code:</strong> <br>

<input type="text" name="zip">

<?php

$sql="SELECT * FROM criteria WHERE type='$type' AND rank<'10';";

$result=@mysql_query($sql,$con) or die(death($sql));

while ($row=mysql_fetch_array($result)){

 

/////////////////////////////////////////////////////////////////////////////

echo "<p><strong>".$row[value].":</strong><br>";

////////////////////////////////////////////////////////////////////////////

 

$sql2="SELECT * FROM criteria WHERE question='$row[question]' AND rank='10';";

$result2=@mysql_query($sql2,$con) or die(death($sql2));

while ($row2=mysql_fetch_array($result2)){

 

$style=$row['style'];

switch ($style) {

    case 1:

        $field=" $row2[value]:<br><input type='radio' name='$row[value]' value='$row2[value]'>";

        break;

    case 2:

        $field="<input type='text' name='$row[value]' > $row2[value]";

        break;

    case 3:

        $field="<input type='checkbox' name='$row[value]' value='$row2[value]'> $row2[value]";

        break;

    case 4:

        $field="<textarea name='$row[value]'></textarea>";

        break;

}

echo $field;

}

echo "</p>";

} ?>

<p><strong>Expect:</strong><br>

<textarea name="expect" cols="50" rows="10"></textarea></p>

<input type="submit" value="Submit">

</form>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.