Jump to content

dubfoundry

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Everything posted by dubfoundry

  1. The following code suppose to output a category sub category list..it only out puts a single row under each category it doesnt do all the subcats...here is the final code i have...i cant figure out why it would only print one row...The sql statement works perfectly in phpadmin.. if(isset($_GET['upload'])&& !isset($_GET['edit_gal'])){ require_once('upload.php'); }elseif(isset($_GET['edit_gal'])){ mysql_select_db($database, $makeconnection); $query = "SELECT * FROM tbl_gallery g, tbl_subgallery s WHERE s.gal_id=g.gal_id ORDER BY s.gal_id"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_assoc($result); $prev_section = null; $sectionHeading = false; //echo '<table border="1" cellpadding="5" cellspacing="2">'; do{ if($prev_section != $row['gal_name']) { $prev_section = $row['gal_name']; $sectionHeading = false; } if(!$sectionHeading) { echo '<h1>' . $row['gal_name'] . '</h1>'; $sectionHeading = true; } else { echo $row['subgal_name'].'<p> </p'; } }while($row = mysql_fetch_assoc($result)); } }
  2. So any thaughts why this is not printing the complete sublist guys??? help
  3. no there is a if statement before the code if(isset($_GET['upload'])&& !isset($_GET['edit_gal'])){ require_once('upload.php'); }elseif(isset($_GET['edit_gal'])){
  4. ok it works but just with one problem it only out puts a single row under each category it doesnt do the rest...here is the final code i have...i cant figure out why it would only print one row... mysql_select_db($database, $makeconnection); $query = "SELECT * FROM tbl_gallery g, tbl_subgallery s WHERE s.gal_id=g.gal_id ORDER BY s.gal_id"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_assoc($result); $prev_section = null; $sectionHeading = false; //echo '<table border="1" cellpadding="5" cellspacing="2">'; do{ if($prev_section != $row['gal_name']) { $prev_section = $row['gal_name']; $sectionHeading = false; } if(!$sectionHeading) { echo '<h1>' . $row['gal_name'] . '</h1>'; $sectionHeading = true; } else { echo $row['subgal_name'].'<p> </p'; } }while($row = mysql_fetch_assoc($result)); }
  5. OK it said no database selected ..i forgot that line...its now working thank fellows.. hey if i have any other problem with it ill let you know.... appreciate it.
  6. I'm working with a simple straight forward code and keep getting this error message mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource here is the code $query = "SELECT * FROM tbl_gallery g, tbl_subgallery s WHERE s.gal_id=g.gal_id ORDER BY s.gal_id"; $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { echo '<pre>' . print_r($row, true) .' </pre>'; } the query works fine in php admin but i keep getting this message... thanx for your help
  7. Ok im attempting a nested regions with php.. just to out put catalouge subcategory type ouput. The categories prints out fine but only the first subcategory outputs the other categories have blank subcats...help? here is my code if(isset($_GET['upload'])&& !isset($_GET['edit_gal'])){ require_once('upload.php'); }elseif(isset($_GET['edit_gal'])){ //require_once('gal_edit.php'); echo "<h2>Edit Albums</h2> <br/>"; ?> <p> </p><?php do{ echo $gallery['gal_name'];?> <span class="under_rule"></span> <p> </p> <?php do{ echo $subgal['gal_name'];?> <?php }while($subgal = mysql_fetch_assoc($get_subgal));?> <p> </p><p> </p> <span class="under_rule"></span> <?php }while($gallery = mysql_fetch_assoc($get_gal));}?>
  8. Thank you i didn't even realize that....
  9. I have this seeamingly simple code that does not execute at all for some reason...i cant figure it out. im using godaddy for hosting and im trying to send a mail via a form...Godady says it doesnt block these type of scripts and it should work...go figure.. Is there a problem with my script preventing it from working? <?php echo "<form id=\"form1\" name=\"form1\" method=\"post\" action=\"\"> <p>Full Name:<br/> <label> <input type=\"text\" name=\"name\" id=\"name\" /> <br /> </label> Email:<br/> <label> <input type=\"text\" name=\"email\" id=\"email\" /> <br /> </label> Phone:<br/> <label> <input type=\"text\" name=\"phone\" id=\"phone\" /> </label> <p>Message:<br/> <label> <textarea name=\"message\" cols=\"23\" rows=\"10\" id=\"message\"></textarea> </label> </p> <p> <label> <input type=\"Submit\" name=\"Submit\" id=\"Submit\" value=\"Submit\" /> </label> </p> </form>"; if(isset($_GET['Submit'])){ $subject = "Consultation Request"; $myEmail ="[email protected]"; $message = $_GET['message']; $phone = $_GET['phone']; $Name = $_GET['name']; $email = $_GET['email']; $mail_body = "From: ". $Name . " <" . $email . ">\r\n". $message." "; echo "Thank you"; mail($myEmail, $subject, $mail_body); }else{ echo "Please Fill the form out"; } ?>
×
×
  • 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.