Jump to content

aquaman

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

aquaman's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [a href=\"http://www.phpfreaks.com/tutorials/85/0.php\" target=\"_blank\"]http://www.phpfreaks.com/tutorials/85/0.php[/a] it in the tutorials section of this site.
  2. [!--quoteo(post=368774:date=Apr 26 2006, 05:46 AM:name=jarsky)--][div class=\'quotetop\']QUOTE(jarsky @ Apr 26 2006, 05:46 AM) [snapback]368774[/snapback][/div][div class=\'quotemain\'][!--quotec--] The unit conversion works but is not quite what I wanted as I would like it to convert to MB/GB/TB and work out which to display it as, as the figures range between few hundred mb's up to few tb's. [/quote] like i said, you would use if / else statments to determine what gets displayed. something like [code] if ($bytes > 1000000000){ echo 'Total Space = ' . $gb . 'gb.'; } [/code] you will just need to incorportate them all into one function.
  3. [!--quoteo(post=368561:date=Apr 25 2006, 02:10 PM:name=EvoX)--][div class=\'quotetop\']QUOTE(EvoX @ Apr 25 2006, 02:10 PM) [snapback]368561[/snapback][/div][div class=\'quotemain\'][!--quotec--] there is php code in the html file. [/quote] how can there be PHP in the html code that is being generated?
  4. Here is the code i was using. to pull the loop and add the url. I was using the same code to call the fullpage link just without the loop. [code] //select everything to display $query = "SELECT * FROM credits ORDER BY id ASC"; $results = mysql_query ($query); //now we must count how many rows are in the db. $num = mysql_num_rows($results); //we have our data so we can close the db. mysql_close(); //Display the results. //run a loop to show all results $i=0; while ($i < $num) { $id = mysql_result($results,$i,"id"); $name = mysql_result($results,$i,"name"); $position = mysql_result($results,$i,"position"); $tagline = mysql_result($results,$i,"tagline"); $bio = mysql_result($results,$i,"bio"); $photo = mysql_result($results,$i,"photo"); //now display the form ?> <link href="styles.css" rel="stylesheet" type="text/css" /> <div align="center">   <table width="350" border="0" cellpadding="5" cellspacing="0" class="outlinebox">     <tr>       <td width="110" align="left" valign="top"><img src="../headshots/<? echo $photo;?>" width="110" height="168" /></td>       <td width="220" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">         <tr>           <td><p><? echo $name;?></p></td>         </tr>         <tr>           <td><img src="nav/images/spacer.gif" width="5" height="5" /></td>         </tr>         <tr>           <td><p><? echo $position; ?></p></td>         </tr>         <tr>           <td><img src="nav/images/spacer.gif" width="5" height="5" /></td>         </tr>         <tr>           <td><p><? echo $tagline; ?>... <span class="fullbiolink">[<a href="../../inc/credits-full.php?id=<? echo $id;?>">more</a>] </span></p></td>         </tr>       </table></td>     </tr>   </table> </div> <br /> <? //this will repeat the table until all rows are displayed. $i++; } ?> [/code]
  5. hmm .. i'm not sure on the date formmating but as for the bytes calculation, i would do somthing like this [code] $bytes = *query your database here* $kb = $bytes / 1024; //1024 being the amount of bites in a kilobyte $mb = $kb / 1024; $gb = $mb / 1024; $tb = $gb / 1024; [/code] and then reference them through out your code as needed. **additional thought, if you wanted to use an if / else statement you could tell the code to look at the $bytes var and display the correct size id based on the amount of bytes. something like [code] if ($bytes > 1000000000){ echo 'Total Space = ' . $gb . 'gb.'; } [/code] PS: I'm a bit a noob myself, so these may not the be perfect way, but they are the ways I have found to work. hope this helps. Chris
  6. ok .. the short version of the problem. on one page i have all the entries from a data base displayed with a "short" descrption and a link to the long description. what i would like to do is when the link is clicked it opens a window with just that entry to the database. i assumed that this would work [code] <a href="../inc/showfull.php?id=<? echo $id; ?>"> [/code] this generates the desired effect. the source code for the page reads [code] <a href="../inc/showfull.php?id=1"> [/code] with the number after the = sign changing in each href depending on the db entry. but the link doesn't only show that entry. I get all the entries in the database. Would someone be so kind as to explain how to dynamically get only one entry based on the id number of the entry. or at least point me where i need to go for the information. Thanks in advance. Chris
×
×
  • 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.