hi i had this script created by a php coder and it worked on another site of mine with same software but now its not working on current site can someone check it out heres code much appreicated

Registartion3.php

<table width="750" cellspacing="5">
   <tr>
         <td></td>
      <td></td>
      <td></td>
      <td></td>

          <?php 
          $multiple = mysql_query("select * from checkboxes order by id asc");
            $i=0;
            while($multipleCheck = mysql_fetch_array($multiple)) { 
            if($i%4==0){
                echo "</tr><tr>";
                }
            ?>
<td width="200">
<input type="checkbox" name="checkbox[]" value="<?php echo $multipleCheck['id'];?>" /> 
<label><?php echo $multipleCheck['name'];?></label></td>

            <?php
            $i++;
            }
        ?>  


      <td></td>
      <td></td>
      <td></td>
      <td></td>
    </tr>
    </table>

profile.php

<table>
        <p> </p>
 <hr />

      <p> </p>
      <b>Your Interests Are:</b><br />

<p></p>
       <?php 

       $mynumber = mysql_query("select * from multiplecheck where userid='$_SESSION[last_id]' ");
      // echo $mynumber;
      while($mynumberGet = mysql_fetch_array($mynumber))
      {
        // echo "select * from checkboxes where id ='$mynumberGet[checkid]'";
          $checkBox = mysql_fetch_array(mysql_query("select * from checkboxes where id ='$mynumberGet[checkid]'"));
          ?>
       <?php echo $checkBox['name']."<p></p>";?>
     <?php
      }
       ?>

       </table>  

database tables without the inserts

CREATE TABLE IF NOT EXISTS `multiplecheck` (
      `id` int(11) NOT NULL,
      `userid` int(11) NOT NULL,
      `checkid` int(11) NOT NULL
    ) ENGINE=MyISAM AUTO_INCREMENT=66 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `checkboxes` (
  `id` int(11) NOT NULL,
  `name` varchar(100) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM AUTO_INCREMENT=89 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Recommended Answers

All 3 Replies

Member Avatar for diafol

deprecated mysql_*
mashed-up php and html
even DB calls/SQL in the middle of markup

If you paid for it, grab him by the proverbials and shake him vigorously. This is very messy and I'm afraid it's making my eyes hurt. Anybody else?

yes unfortunately i paid for it what would be the best solution to fix it hun

Member Avatar for diafol

I'd throw it away and start again. Seriously, It's that bad.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.