Jump to content

wizardry

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Everything posted by wizardry

  1. i've tried what you showed and that was for the wrong query of which that did work for the parent query. when i tried to move this to the above position of: echo '<tr>'; echo '<td colspan="4" style="padding-left:1em;">'; // display table echo '<a href="#0'."$SFK1".'" onclick="toggle_visibility(\'foo1'\');" ;return false\" style=\"position:relative\">Click here to show records</a>'; // to show comment records //echo '<div id="foo1'."$SFK1".'"style="position:relative;display:none">'; // to show comment records echo '<table align="center" width="60%" border="3" cellpadding="0" cellspacing="0" id="foo1">'; while($user_row = mysql_fetch_array($statusComments)){ my code went to the left side of the screen and was nolonger apart of the table. in my current design in order to have my data elements in one table ive had to use a nested table of which is in the subquery. thanks in advance for your help!
  2. i've tried what you've explained to me. here is the code that i used can you show me an example? thanks in advance for your help! echo '<a href="#0'."$SFK1".'" onclick="toggle_visibility(\'foo0'."$SFK1".'\');" ;return false\" style=\"position:relative\">Click here to show records</a>'; // to show comment records //echo '<div >'; // to show comment records echo '<table align="center" width="60%" border="3" cellpadding="0" cellspacing="0" id="foo0'."$SFK1".'"style="position:relative;display:none">'; [attachment deleted by admin]
  3. i've tried that with both the table and the div they both have id with the record number which make them unique considering that they are being looped until there are no more matching records. Niether of them work just single record display.
  4. i have the onclick function created already. it shows the results but only 1 result at a time. for instance their are 5 records it only shows 1 record.
  5. how do i get this to loop through all record sets instead of just showing one record set on click for sub query? <script type="text/javascript"> <!-- function toggle_visibility(id) { var e = document.getElementById(id); if(e.style.display == 'block') e.style.display = 'none'; else e.style.display = 'block'; } //--> </script> </head> <body> <?php //c.sfk={$row['sfk']} mysql_select_db($database_Del_Comments, $Del_Comments); $result = sprintf("SELECT a.Id, a.Type, a.Dates, a.UIdFk as UIdFk, b.Id as Did, b.comment as Comment, b.dates as Day, b.sfk as Sfk , aes_decrypt(e.ProfileName, '$Ukey') as Name, substr(i.Path, 4) as Path FROM asstatusupdate as a left join asstatusdata as b on a.id = b.sfk right join ASWebInfo as e on e.Uidfk = a.uidfk right join ASManyAlbums as f on f.UserId=a.uidfk right join ASAlbums as g on f.AlbumId=g.Id right join ASTitle as h on g.Id=h.AlbumId right join ASData as i on h.Id=i.TitleId where a.uidfk in (select friendid from asfriends where uidfk0='1') and i.DefaultProfilePic='Y' order by dates desc; "); $statusUpdate = mysql_query($result, $Del_Comments) or die(mysql_error()); $category_id = ''; echo '<table align="center" width="40%" border="3" cellpadding="0" cellspacing="0">'; while($row = mysql_fetch_array($statusUpdate)) { if ($row['Id'] != $category_id) { $category_id = $row['Id']; // grab table variables $Type = $row['Type']; $Dates = $row['Dates']; $Comment = $row['Comment']; $Name = $row['Name']; $Path = $row['Path']; $FriendId = $row['UIdFk']; $SFK = $row['Sfk']; echo '<tr>'; echo ' <td align="center">', $Name, '<br><a href="source/source.php?FriendId=',$FriendId,'"><img src="',$Path,'" height="120" width="120" align="middle" border="3" /></a></td>'; echo ' <td align="center"> ',$Dates,'<br><br>',$Type,'<br/>',$Comment,'</td>'; echo ' <td>',$category_id,'</td>'; echo ' <td>',$SFK,'</td>'; echo '</tr>'; } // end of if mysql_select_db($database_Del_Comments, $Del_Comments); $comments= sprintf("SELECT c.sfk as sfk1, c.UIdFk0, d.Memo as Memo, d.Date as Dates1, e.ProfileName, substr(i.Path, 4) as Path FROM asmanystatusupdate as c left join ascomments as d on d.id = c.cfk right join ASWebInfo as e on e.Uidfk = c.uidfk0 right join ASManyAlbums as f on f.UserId=c.uidfk0 right join ASAlbums as g on f.AlbumId=g.Id right join ASTitle as h on g.Id=h.AlbumId right join ASData as i on h.Id=i.TitleId where c.sfk={$row['Sfk']} AND c.uidfk0 in (select friendid from asfriends where uidfk0='1') and i.DefaultProfilePic='Y' order by dates desc; "); $statusComments = mysql_query($comments, $Del_Comments) or die(mysql_error()); while($user_row = mysql_fetch_array($statusComments)){ // test the query //if($row['sfk'] == $user_row['sfk']) { $Dates1 = $user_row['Dates1']; $Memo = $user_row['Memo']; $Name1 = $user_row['Name']; $Path1 = $user_row['Path']; $FriendId1 = $user_row['UIdFk0']; $SFK1 = $user_row['sfk1']; //row and cell for "outer" while echo '<tr>'; echo '<td colspan="4" style="padding-left:1em;">'; // display table echo '<a href="#0'."$SFK1".'" onclick="toggle_visibility(\'foo1'."$SFK1".'\');" ;return false\" style=\"position:relative\">Click here to show records</a>'; // to show comment records echo '<div id="foo1'."$SFK1".'"style="position:relative;display:none">'; // to show comment records echo '<table align="center" width="60%" border="3" cellpadding="0" cellspacing="0">'; echo '<tr>'; echo ' <td align="center">',$Name1,'<br/><a href="source/source.php?FriendId=',$FriendId1,'"><img src="',$Path1,'" height="120" width="120" align="middle" border="3" /></a></td>'; echo ' <td align="center" width="40%"> ',$Dates1,'<br/><br/><br/>',$Memo,'</td>'; echo ' <td>' ,$category_id, '</td>'; echo ' <td>',$SFK1,'</td>'; echo '</tr>'; echo '</table>'; echo '</div>'; // for comment results show query //end row and cell for outer while //echo '</td>'; //echo '</tr>'; echo '<form action="$editFormAction" method="post" name="form1" id="form1">'; echo '<a href="#'."$SFK1".'" onclick="toggle_visibility(\'foo'."$SFK1".'\');" ;return false\" style=\"position:relative\">Click here to toggle visibility of element #foo</a>'; echo '<div id="foo'."$SFK1".'"style="position:relative;display:none">';echo '<table align="center">'; echo '<tr valign="baseline">'; echo '<td nowrap="nowrap" align="right">Memo:</td>'; echo '<td><input type="text" name="Memo" value="" size="32" /></td>'; echo '</tr>'; echo '<tr valign="baseline">'; echo '<td nowrap="nowrap" align="right"> </td>'; echo ' <td nowrap="nowrap" align="right"> </td>'; echo ' </tr>'; echo '<tr valign="baseline">'; echo ' <td nowrap="nowrap" align="right"> SFK:' ."$SFK1". '</td>'; echo ' <td><input type="submit" value="Insert record" /></td>'; echo ' </tr>'; echo ' </table>'; echo '<input type="hidden" name="Id" value="" />'; echo '<input type="hidden" name="Id" value="" />'; echo ' <input type="hidden" name="SFk" value="' ."$SFK1". '" />'; echo ' <input type="hidden" name="MM_insert" value="form1" />'; echo '</form>'; echo '</div>'; } // end of if } // end of while loop }// end of main loop echo '</table>'; ?>
  6. how do i get this insert form to display for the results record id 1 once and record id 2 once instead of looping though all of foreign keys for record 1. this is in refferance to the code for sub query insert form on click. for example: i have 10 records for record id 1 then the last record for 1 id is 10 that should show the insert form. instead of having all 10 records showing the form. here is an example: www.only1wizard.com/UntitledDocument.pdf thanks in advance for your help! <script type="text/javascript"> <!-- function toggle_visibility(id) { var e = document.getElementById(id); if(e.style.display == 'block') e.style.display = 'none'; else e.style.display = 'block'; } //--> </script> </head> <body> <?php //c.sfk={$row['sfk']} mysql_select_db($database_Del_Comments, $Del_Comments); $result = sprintf("SELECT a.Id, a.Type, a.Dates, a.UIdFk as UIdFk, b.Id as Did, b.comment as Comment, b.dates as Day, b.sfk as Sfk , aes_decrypt(e.ProfileName, '$Ukey') as Name, substr(i.Path, 4) as Path FROM asstatusupdate as a left join asstatusdata as b on a.id = b.sfk right join ASWebInfo as e on e.Uidfk = a.uidfk right join ASManyAlbums as f on f.UserId=a.uidfk right join ASAlbums as g on f.AlbumId=g.Id right join ASTitle as h on g.Id=h.AlbumId right join ASData as i on h.Id=i.TitleId where a.uidfk in (select friendid from asfriends where uidfk0='1') and i.DefaultProfilePic='Y' order by dates desc; "); $statusUpdate = mysql_query($result, $Del_Comments) or die(mysql_error()); $category_id = ''; echo '<table align="center" width="40%" border="3" cellpadding="0" cellspacing="0">'; while($row = mysql_fetch_array($statusUpdate)) { if ($row['Id'] != $category_id) { $category_id = $row['Id']; // grab table variables $Type = $row['Type']; $Dates = $row['Dates']; $Comment = $row['Comment']; $Name = $row['Name']; $Path = $row['Path']; $FriendId = $row['UIdFk']; $SFK = $row['Sfk']; echo '<tr>'; echo ' <td align="center">', $Name, '<br><a href="source/source.php?FriendId=',$FriendId,'"><img src="',$Path,'" height="120" width="120" align="middle" border="3" /></a></td>'; echo ' <td align="center"> ',$Dates,'<br><br>',$Type,'<br/>',$Comment,'</td>'; echo ' <td>',$category_id,'</td>'; echo ' <td>',$SFK,'</td>'; echo '</tr>'; } // end of if mysql_select_db($database_Del_Comments, $Del_Comments); $comments= sprintf("SELECT c.sfk as sfk1, c.UIdFk0, d.Memo as Memo, d.Date as Dates1, e.ProfileName, substr(i.Path, 4) as Path FROM asmanystatusupdate as c left join ascomments as d on d.id = c.cfk right join ASWebInfo as e on e.Uidfk = c.uidfk0 right join ASManyAlbums as f on f.UserId=c.uidfk0 right join ASAlbums as g on f.AlbumId=g.Id right join ASTitle as h on g.Id=h.AlbumId right join ASData as i on h.Id=i.TitleId where c.sfk={$row['Sfk']} AND c.uidfk0 in (select friendid from asfriends where uidfk0='1') and i.DefaultProfilePic='Y' order by dates desc; "); $statusComments = mysql_query($comments, $Del_Comments) or die(mysql_error()); while($user_row = mysql_fetch_array($statusComments)){ // test the query //if($row['sfk'] == $user_row['sfk']) { $Dates1 = $user_row['Dates1']; $Memo = $user_row['Memo']; $Name1 = $user_row['Name']; $Path1 = $user_row['Path']; $FriendId1 = $user_row['UIdFk0']; $SFK1 = $user_row['sfk1']; //row and cell for "outer" while echo '<tr>'; echo '<td colspan="4" style="padding-left:1em;">'; // display table echo '<a href="#0'."$SFK1".'" onclick="toggle_visibility(\'foo1'."$SFK1".'\');" ;return false\" style=\"position:relative\">Click here to show records</a>'; // to show comment records echo '<div id="foo1'."$SFK1".'"style="position:relative;display:none">'; // to show comment records echo '<table align="center" width="60%" border="3" cellpadding="0" cellspacing="0">'; echo '<tr>'; echo ' <td align="center">',$Name1,'<br/><a href="source/source.php?FriendId=',$FriendId1,'"><img src="',$Path1,'" height="120" width="120" align="middle" border="3" /></a></td>'; echo ' <td align="center" width="40%"> ',$Dates1,'<br/><br/><br/>',$Memo,'</td>'; echo ' <td>' ,$category_id, '</td>'; echo ' <td>',$SFK1,'</td>'; echo '</tr>'; echo '</table>'; echo '</div>'; // for comment results show query //end row and cell for outer while //echo '</td>'; //echo '</tr>'; echo '<form action="$editFormAction" method="post" name="form1" id="form1">'; echo '<a href="#'."$SFK1".'" onclick="toggle_visibility(\'foo'."$SFK1".'\');" ;return false\" style=\"position:relative\">Click here to toggle visibility of element #foo</a>'; echo '<div id="foo'."$SFK1".'"style="position:relative;display:none">';echo '<table align="center">'; echo '<tr valign="baseline">'; echo '<td nowrap="nowrap" align="right">Memo:</td>'; echo '<td><input type="text" name="Memo" value="" size="32" /></td>'; echo '</tr>'; echo '<tr valign="baseline">'; echo '<td nowrap="nowrap" align="right"> </td>'; echo ' <td nowrap="nowrap" align="right"> </td>'; echo ' </tr>'; echo '<tr valign="baseline">'; echo ' <td nowrap="nowrap" align="right"> SFK:' ."$SFK1". '</td>'; echo ' <td><input type="submit" value="Insert record" /></td>'; echo ' </tr>'; echo ' </table>'; echo '<input type="hidden" name="Id" value="" />'; echo '<input type="hidden" name="Id" value="" />'; echo ' <input type="hidden" name="SFk" value="' ."$SFK1". '" />'; echo ' <input type="hidden" name="MM_insert" value="form1" />'; echo '</form>'; echo '</div>'; } // end of if } // end of while loop }// end of main loop echo '</table>'; ?>
  7. yes i would like to know what your thoughts are.
  8. here is the login information for the demo account. the user name: demo@only1wizard.com the password: DE20mo11
  9. My loop for the comments image is not displaying the users image and name it loops and displays the first one ( image for that record set ). thanks in advance for your help. <?php $result = mysql_query("SELECT a.Id, a.Type, a.Dates, a.Uidfk as Uidfk, b.Id as Did, b.comment as Comment, b.dates as Day, b.sfk as Sfk , c.sfk as sfk1, d.Memo as Memo, d.Date as Dates1, aes_decrypt(e.ProfileName, '$Ukey') as Name, substr(i.Path, 4) as Path FROM asstatusupdate as a left join asstatusdata as b on a.id = b.sfk left join asmanystatusupdate as c on b.sfk = c.sfk left join ascomments as d on d.id = c.cfk right join onlyonew_hquis.ASWebInfo as e on e.Uidfk = a.uidfk right join onlyonew_hqups.ASManyAlbums as f on f.UserId=a.uidfk right join onlyonew_hqups.ASAlbums as g on f.AlbumId=g.Id right join onlyonew_hqups.ASTitle as h on g.Id=h.AlbumId right join onlyonew_hqups.ASData as i on h.Id=i.TitleId where a.uidfk in (select friendid from onlyonew_hquis.asfriends where uidfk0='1') and i.DefaultProfilePic='Y' order by dates desc; "); $category_id = ''; while ($row = mysql_fetch_assoc($result)) { if ($row['Id'] != $category_id) { //Output the markup for a new category here. $category_id = $row['Id']; $Cat = $row['Type']; $Memo = $row['Comment']; $Did = $row['Did']; $Dates = $row['Day']; $Name = $row['Name']; $Path = $row['Path']; $FriendId = $row['Uidfk']; echo '<table align="center" width="40%" border="3" cellpadding="0" cellspacing="0">'; echo '<tr>'; echo '<td align="center">'; echo "$Name"; echo "</br>"; echo '<a href="source/source.php?FriendId=' ."$FriendId". '"><img src="' ."$Path". '" height="120" width="120" align="middle" border="3" /></a>'; echo '</td>'; echo '<td align="center"> '; echo "$Dates" ; echo "</br>"; echo "</br>"; echo "$Cat"; //echo "</td>"; echo "</br>"; echo "$Memo"; echo '</td>'; // echo "</br>"; echo '<td>'; echo "$Did" ; echo '</td>'; echo '</tr>'; echo '</table>'; } // Output comment markup here if(!empty($row['sfk1'])){ $Fk = $row['sfk1']; $Memo1 = $row['Memo']; $FriendId1 = $row['Uidfk']; $Dates1 = $row['Dates']; $Path1 = $row['Path']; echo '<table align="center" width="500" border="3" cellpadding="7" cellspacing="0">'; echo '<tr>'; echo '<td align="center">'; echo "$Name"; echo "</br>"; echo '<a href="source/source.php?FriendId=' ."$FriendId1". '"><img src="' ."$Path1". '" height="120" width="120" align="middle" border="3" /></a>'; echo '</td>'; echo '<td>'; echo "$Fk"; echo '</td>'; // echo "</br>"; echo '<td align="center">'; echo "$Dates1"; echo "</br>"; echo "</br>"; echo "$Memo1"; echo '</td>'; // echo "</br>"; echo '</tr>'; echo '</table>'; } } ?>
  10. its my own error it was echo ../directoryname when its not in the sub domains im still developing it.
  11. i have another problem; the image is not displaying its just showing the border. ii know the image path is being caught in the variable. i just dont understand thanks in advance for your help. <?php $result = mysql_query("SELECT a.Id, a.Type, a.Dates, a.Uidfk as Uidfk, b.Id as Did, b.comment as Comment, b.dates as Day, b.sfk as Sfk , c.sfk as sfk1, d.Memo as Memo, aes_decrypt(e.ProfileName, '$Ukey') as Name, i.Path as Path FROM asstatusupdate as a left join asstatusdata as b on a.id = b.sfk left join asmanystatusupdate as c on b.sfk = c.sfk left join ascomments as d on d.id = c.cfk right join onlyonew_hquis.ASWebInfo as e on e.Uidfk = a.uidfk right join onlyonew_hqups.ASManyAlbums as f on f.UserId=a.uidfk right join onlyonew_hqups.ASAlbums as g on f.AlbumId=g.Id right join onlyonew_hqups.ASTitle as h on g.Id=h.AlbumId right join onlyonew_hqups.ASData as i on h.Id=i.TitleId where a.uidfk='1' and i.DefaultProfilePic='Y'; "); $category_id = ''; while ($row = mysql_fetch_assoc($result)) { if ($row['Id'] != $category_id) { //Output the markup for a new category here. $category_id = $row['Id']; $Cat = $row['Type']; $Memo = $row['Comment']; $Did = $row['Did']; $Dates = $row['Day']; $Name = $row['Name']; $Path = $row['Path']; $FriendId = $row['Uidfk']; echo '<table align="center" width="40%" border="3" cellpadding="0" cellspacing="0">'; echo '<tr>'; echo '<td align="center">'; echo "$Name"; echo "</br>"; echo '<a href="source/source.php?FriendId=' ."$FriendId". '"><img src="' ."$Path". '" height="120" width="120" align="middle" border="3" /></a>'; echo '<td> '; echo "$Cat"; echo "</td>"; // echo "</br>"; echo '<td>' ; echo "$Memo"; echo '</td>'; // echo "</br>"; echo '<td>'; echo "$Did" ; echo '</td>'; echo '<td>'; echo "$Dates" ; echo '</td>'; echo '</tr>'; echo '</table>'; } // Output comment markup here $Fk = $row['sfk1']; $Memo1 = $row['Memo']; echo '<table align="center" width="500" border="3" cellpadding="7" cellspacing="0">'; echo '<tr>'; echo '<td>'; echo "$Fk"; echo '</td>'; // echo "</br>"; echo '<td>'; echo "$Memo1"; echo '</td>'; // echo "</br>"; echo '</tr>'; echo '</table>'; } ?>
  12. im creating a social networking site like facebook, myspace. looking for some suggestions. the web site is: www.only1wizard.com
  13. i got it i had to remove the <br> thanks for your help.
  14. here is the code i'm trying to get a table displaying correctly it has spacers between records. thanks in advance for your help. <?php $result = mysql_query("SELECT a.id as id, a.catagory as cat, a.memo as memo, a.dates as day, b.fk as fk, b.memo as memo1 FROM type as a left join memo as b on a.id = b.fk "); $category_id = ''; while ($row = mysql_fetch_assoc($result)) { if ($row['id'] != $category_id) { //Output the markup for a new category here. $category_id = $row['id']; $Cat = $row['cat']; $Memo = $row['memo']; echo '<table align="center" width="500" border="3" cellpadding="0" cellspacing="0">'; echo '<tr>'; echo '<td> '; echo "$Cat"; echo "</td>"; echo "</br>"; echo '<td>' ; echo "$Memo"; echo '</td>'; echo "</br>"; echo '</tr>'; // echo '</table>'; } // Output comment markup here $Fk = $row['fk']; $Memo1 = $row['memo1']; // echo '<table align="center" width="500" border="3" cellpadding="0" cellspacing="0">'; echo '<tr>'; echo '<td>'; echo "$Fk"; echo '</td>'; echo "</br>"; echo '<td>'; echo "$Memo1"; echo '</td>'; echo "</br>"; echo '</tr>'; echo '</table>'; } ?>
  15. thank you i just have a mirc up of the dev code i will post my test code once ive completed. thank you for your help this is the results i was looking for.
  16. i can get the id in the loop but what i dont get is the grouping of the catagory can you show me a more advanced example. thanks in advance for your help.
  17. can you show me an example of the loop to use?
  18. i'm trying to achive this results layout: example: catagory comment comment comment catagory catagory catagory comment what is being pulled now is if their is 2 comments two 1 catagory then 2 catagorys are being returned with the same id. what i want is to return one cataogry with many comments. thanks in advance for your help. <?php require_once('Connections/Del_Comments.php'); ?> <?php $all_ids = array(); $str_ids = ""; // first parent query $maxRows_sourceType = 10; $pageNum_sourceType = 0; if (isset($_GET['pageNum_sourceType'])) { $pageNum_sourceType = $_GET['pageNum_sourceType']; } $startRow_sourceType = $pageNum_sourceType * $maxRows_sourceType; mysql_select_db($database_Del_Comments, $Del_Comments); $query_sourceType = "SELECT a.Id, a.Type, a.Dates, a.UIdFk, b.Id as Did, b.comment, b.dates as Day, b.sfk as Sfk , c.sfk as sfk1, d.Memo as memo FROM asstatusupdate as a left join asstatusdata as b on a.id = b.sfk left join asmanystatusupdate as c on b.sfk = c.sfk left join ascomments as d on d.id = c.cfk where a.uidfk='1' order by Dates asc"; $query_limit_sourceType = sprintf("%s LIMIT %d, %d", $query_sourceType, $startRow_sourceType, $maxRows_sourceType); $sourceType = mysql_query($query_limit_sourceType, $Del_Comments) or die(mysql_error()); $row_sourceType = mysql_fetch_assoc($sourceType); if (isset($_GET['totalRows_sourceType'])) { $totalRows_sourceType = $_GET['totalRows_sourceType']; } else { $all_sourceType = mysql_query($query_sourceType); $totalRows_sourceType = mysql_num_rows($all_sourceType); } $totalPages_sourceType = ceil($totalRows_sourceType/$maxRows_sourceType)-1; // add the array while ($row_source = mysql_fetch_assoc($sourceType)) { $all_ids[] = $row_source['Sfk']; $str_ids .= $row_source['Sfk'].','; } // remove the array $str_ids = (substr($str_ids,-1) == ',') ? substr($str_ids, 0, -1) : $str_ids; echo $str_ids; //echo $all_ids; //second child query $maxRows_sourceComments = 10; $pageNum_sourceComments = 0; if (isset($_GET['pageNum_sourceComments'])) { $pageNum_sourceComments = $_GET['pageNum_sourceComments']; } $startRow_sourceComments = $pageNum_sourceComments * $maxRows_sourceComments; mysql_select_db($database_Del_Comments, $Del_Comments); $query_sourceComments = "SELECT c.sfk as sfk1, d.Memo as memo FROM asmanystatusupdate as c left join ascomments as d on d.id = c.cfk where c.uidfk0='1' and c.sfk in ($str_ids)"; $query_limit_sourceComments = sprintf("%s LIMIT %d, %d", $query_sourceComments, $startRow_sourceComments, $maxRows_sourceComments); $sourceComments = mysql_query($query_limit_sourceComments, $Del_Comments) or die(mysql_error()); $row_sourceComments = mysql_fetch_assoc($sourceComments); if (isset($_GET['totalRows_sourceComments'])) { $totalRows_sourceComments = $_GET['totalRows_sourceComments']; } else { $all_sourceComments = mysql_query($query_sourceComments); $totalRows_sourceComments = mysql_num_rows($all_sourceComments); } $totalPages_sourceComments = ceil($totalRows_sourceComments/$maxRows_sourceComments)-1; $resultComments = @mysql_query($query_sourceComments, $Del_Comments); $numComments = @mysql_num_rows($resultComments); $result = @mysql_query($query_sourceType, $Del_Comments); $num = @mysql_num_rows($result); // column count for parent $thumbcols = 1; // column count for parent query $thumbrows = 1+ round($num / $thumbcols); // column count for child query $thumbrowsComments = 1+ round($numComments/$thumbcols); // header print '<br />'; print '<table align="center" width="500" border="3" cellpadding="0" cellspacing="0">'; if (!empty($num)) { print '<tr><td colspan="3" align="center"><strong>Returned Num of Record Sets: ' .$num. ' and comments count' .$numComments. '</strong></td></tr>'; } // table layout for parent query function display_table() { // global variables global $num, $result, $thumbrows, $thumbcols, $resultComments, $numComments, $thumbrowsComments ; // row count for parent for ($r=1; $r<=$thumbrows; $r++) { // print table row print '<tr>'; //format the columns for ($c=1; $c<=$thumbcols; $c++) { print '<td align="center" valign="top">'; $row = @mysql_fetch_array($result); $row1 = @mysql_fetch_array($resultComments); $Id = $row['Id']; $Type = $row['Type']; $Dates = $row['Dates']; $Comment = $row['Comment']; $Sfk1 = $row['sfk1']; $Memo = $row['memo']; // test if not empty show record sets if (!empty($Id)) { // print output from parent query // grab type dates comment and format for there column echo '<td valign="top" align="center">'; echo "$Type"; echo ' '; echo "$Dates"; echo '<br />';echo '<br />';echo '<br />'; echo "$Comment"; echo '</td>'; echo '<td>'; echo "$Id"; echo '</td>'; echo '<td>'; echo "$str_ids"; echo '</td>'; echo '<tr>'; echo '<td>'; echo "$Sfk1"; echo '</td>'; echo '<td>'; echo "$Memo"; echo '</td>'; echo '</tr>'; } // closing the $id loop else { print ' '; } print '</td>'; //closing the table data } //closing the rows print '</tr>'; } // closing the outter loop //} //closing fk id loop print '</td>'; //closing the table data } //closing the rows print '</tr>'; //} // closing the main loop // call the main table display_table() ; print '</table>'; ?> <?php var_dump(substr('a', 1)); // bool(false) ?>
  19. hello - im still having a problem. this array will set but only shows one record from the array. when there are 3 demo data sets. thanks in advance for your help. i want to store the variable id in an array and access that array through session id hyper link on the same page. so that when that hyper link is clicked the session id is passed to the next page. here is the page code: <?php if (!isset($_SESSION)) { session_start(); } ?> <?php require_once('conn.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $Id = $_SESSION['Id']; //get users id to pass to record $Name = $_SESSION['name']; // display users name $Group = $_SESSION['Group']; // access control group for moderators, members, users $maxRows_List = 10; $pageNum_List = 0; if (isset($_GET['pageNum_List'])) { $pageNum_List = $_GET['pageNum_List']; } $startRow_List = $pageNum_List * $maxRows_List; mysql_select_db($database_List, $List); $query_List = "SELECT * WHERE b.UId1='$UserId'"; $query_limit_List = sprintf("%s LIMIT %d, %d", $query_List, $startRow_List, $maxRows_List); $List = mysql_query($query_limit_List, $List) or die(mysql_error()); $row_List = mysql_fetch_assoc($List); $List_Array = array(); while ($row = mysql_fetch_array($List)) { foreach($row['Id'] as $i=>$val) $List_Array = $val; //return $List_Array; $_SESSION['Id'] = $List_Array; $myList_Array = $_SESSION['Id']; } if (isset($_GET['totalRows_List'])) { $totalRows_List = $_GET['totalRows_List']; } else { $all_List = mysql_query($query_List); $totalRows_List = mysql_num_rows($all_List); } $totalPages_List = ceil($totalRows_List/$maxRows_List)-1; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> <!-- body { font: 100% Verdana, Arial, Helvetica, sans-serif; background: #666666; margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */ padding: 0; text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */ color: #000000; background-color: #0E03D6; } .thrColLiqHdr #container { width: 80%; /* this will create a container 80% of the browser width */ background: #FFFFFF; margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */ border: 1px solid #000000; text-align: left; /* this overrides the text-align: center on the body element. */ } .thrColLiqHdr #header { background: #FFFFFF; padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */ } .thrColLiqHdr #header h1 { margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */ padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */ } /* Tips for sidebars: 1. Since we are working in percentages, it's best not to use side padding on the sidebars. It will be added to the width for standards compliant browsers creating an unknown actual width. 2. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the ".thrColLiqHdr #sidebar1 p" rule. 3. Since Explorer calculates widths after the parent element is rendered, you may occasionally run into unexplained bugs with percentage-based columns. If you need more predictable results, you may choose to change to pixel sized columns. */ .thrColLiqHdr #sidebar1 { float: left; /* this element must precede in the source order any element you would like it be positioned next to */ width: 22%; /* since this element is floated, a width must be given */ background: #FFFFFF; /* the background color will be displayed for the length of the content in the column, but no further */ padding: 15px 0; /* top and bottom padding create visual space within this div */ } .thrColLiqHdr #sidebar2 { float: right; /* this element must precede in the source order any element you would like it be positioned next to */ width: 23%; /* since this element is floated, a width must be given */ background: #FFFFFF; /* the background color will be displayed for the length of the content in the column, but no further */ padding: 15px 0; /* top and bottom padding create visual space within this div */ } .thrColLiqHdr #sidebar1 p, .thrColLiqHdr #sidebar1 h3, .thrColLiqHdr #sidebar2 p, .thrColLiqHdr #sidebar2 h3 { margin-left: 10px; /* the left and right margin should be given to every element that will be placed in the side columns */ margin-right: 10px; } /* Tips for mainContent: 1. the space between the mainContent and sidebars is created with the left and right margins on the mainContent div. 2. to avoid float drop at a supported minimum 800 x 600 resolution, elements within the mainContent div should be 300px or smaller (this includes images). 3. in the Internet Explorer Conditional Comment below, the zoom property is used to give the mainContent "hasLayout." This avoids several IE-specific bugs. */ .thrColLiqHdr #mainContent { margin: 0 24% 0 23.5%; /* the right and left margins on this div element creates the two outer columns on the sides of the page. No matter how much content the sidebar divs contain, the column space will remain. You can remove this margin if you want the #mainContent div's text to fill the sidebar spaces when the content in each sidebar ends. */ } .thrColLiqHdr #footer { padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */ background:#FFFFFF; } .thrColLiqHdr #footer p { margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */ padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */ } /* Miscellaneous classes for reuse */ .fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */ float: right; margin-left: 8px; } .fltlft { /* this class can be used to float an element left in your page The floated element must precede the element it should be next to on the page. */ float: left; margin-right: 8px; } .clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain its child floats */ clear:both; height:0; font-size: 1px; line-height: 0px; } #apDiv1 { position:absolute; left:206px; top:83px; width:151px; height:34px; z-index:1; } #apDiv2 { position:absolute; left:363px; top:84px; width:519px; height:37px; z-index:2; } --> </style><!--[if IE]> <style type="text/css"> /* place css fixes for all versions of IE in this conditional comment */ .thrColLiqHdr #sidebar2, .thrColLiqHdr #sidebar1 { padding-top: 30px; } .thrColLiqHdr #mainContent { zoom: 1; padding-top: 15px; } /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */ </style> <![endif]--> <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script> <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" /> </head> <body class="thrColLiqHdr"> <div id="container"> <div id="header"> <h1> </h1> <p> </p> <p> </p> <!-- end #header --></div> <div id="sidebar1"> <h3> </h3> <!-- show users ratings overall and per list --> <!-- end #sidebar1 --></div> <div id="sidebar2"> <h3> </h3> <!-- display current viewers of user list in space and show count of number of views --> <!-- end #sidebar2 --></div> <div id="mainContent"> <h1> </h1> <blockquote> <table border="1" cellpadding="1" cellspacing="1"> <tr></tr> <caption align="center"> List Click to Edit </caption> <?php do { ?> <tr> <td><a href="list.php"><?php echo $myList_Array['Id']; ?></a></td> <-- this is the column that i want to have access the session id --> <td><?php echo $row_List['Subject'];?></td> <td><?php echo $row_List['Date']; ?></td> </tr> <?php } while($row_List = mysql_fetch_assoc($List)); ?> </table> <h2> </h2> <p> </p> </blockquote> <!-- end #mainContent --></div> <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" /> <div id="footer"> <p>Footer</p> <!-- end #footer --></div> <!-- end #container --></div> </body> </html> <?php mysql_free_result($List); ?>
  20. thanks for the repsonse looking at the link. what i dont get is that your using array with assign variables. my arrays are dynamic; coming from mysql query my array = mysql_result($query,0,'Id') how should i assign that to the array, i've tried using something like that but it pulls one id into the session variable.
  21. can you show me a detail example? i've tried creating it like other arrays but the session value just stores one id not two.
  22. hello - trying to get a link to pass the value to another page from a mysql query in php hyper link. most of my site is with sessions. Can we create an array of sessions? session[0], session[1]? because each id would need to have a session id. final outcome: // session variables for links $result = mysql_result($query,0,'Id'); $_SESSION['Id']=$result; $sesId=$_SESSION['Id']; <td><a href="url.php"><?php echo $sesId['Id']; ?></a></td> thanks in advance for your help. theo werntz ii
  23. yes they are in a seperate conf.php which is included in the file i just left that line out.
  24. lol..... if you refer to unrelenting last posted unrelenting said that one of the backups was to memory consumming and still errored out. well second time as in plural. asumming using proper english would mean more then one. yes there are multiple ways of creating a backup and putting it on a schedule. but any who next subject. since you have time to question my responses to this post; can you question and possibly help me on this one that i posted topic: mysql insert loop thanks in advance
×
×
  • 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.