Posts by timmylogue

328 posts
  • Has been part of the Envato Community for over 8 years
  • Has collected 100+ items on Envato Market
  • Located in United States
timmylogue
says

are you first connecting to your database ?

Yup! of course :)

I got it working now! Thanks guys, you rock!

$sql = "SELECT * FROM albums WHERE id = 21 LIMIT 0, 30 ";

$something= mysql_query($sql) or die(mysql_error());
while ($row = mysql_fetch_assoc($something)) {
echo $row['id'];
}
328 posts
  • Has been part of the Envato Community for over 8 years
  • Has collected 100+ items on Envato Market
  • Located in United States
timmylogue
says

SELECT * FROM something WHERE id = 21
Fiddle http://sqlfiddle.com/#!2/3006ee/1

Hey, thanks for the speedy reply! I see how that was done… but I’m looking for a way to do this in php to echo is out.

If I do something like this:

$sql = "SELECT * FROM albums WHERE id = 21 LIMIT 0, 30 ";
echo $sql;

Would that make sense? Doesn’t seem to be working though…

Thanks again!

328 posts
  • Has been part of the Envato Community for over 8 years
  • Has collected 100+ items on Envato Market
  • Located in United States
timmylogue
says

So, i’m creating a login membership. When the user logs in, they have an unique ID that was placed in a MYSQL table from when they registered.

For example, one user has an ID of 21 and at the moment they have 3 rows with the ID 21.

My question is:
How to I get those rows and only those rows to display them in php for each unique ID (user) depending on how many they have? So, for this example, it would display the number “21” three times….

Thanks
Timothy

328 posts
  • Has been part of the Envato Community for over 8 years
  • Has collected 100+ items on Envato Market
  • Located in United States
timmylogue
says

Hey dtbaker,
Do you mind helping me out one last time? I’ve been trying to figure it out but no luck.

I’m trying to do the same but inside each directories like “tim” and “scott”, there is another directory called “photos”. All directories have this, but only some contain files (like .jpgs) inside the “photos” directory and some don’t.

I want to display the directories that have any type of file inside the “photos” directory.

I was messing around with it:

$directories_to_display = array();
foreach(glob('users/*') as $directory){
  if(is_dir($directory) && file_exists($directory . '/photos/' )){
     $directories_to_display[] = $directory;
  }
}

Thanks!

328 posts
  • Has been part of the Envato Community for over 8 years
  • Has collected 100+ items on Envato Market
  • Located in United States
timmylogue
says

Thanks dtbaker! Worked!

328 posts
  • Has been part of the Envato Community for over 8 years
  • Has collected 100+ items on Envato Market
  • Located in United States
timmylogue
says

Hey guys,

I’m trying to figure out (with php) how to list directory names that only have the file named “profile.png” inside.

So.. I have about 30 directories inside one main directory called “users”.

Inside the “users” directory, there are other directories like:

  • users/tim
  • users/bob
  • users/scott
  • users/john

  • Only a few of those directories (like tim, scott and john) carry the file named “profile.png”. I would like to display those directories just on a page. Thats it.

    Any help would be appreciated!

    - Tim

    328 posts
    • Has been part of the Envato Community for over 8 years
    • Has collected 100+ items on Envato Market
    • Located in United States
    timmylogue
    says

    Nevermind! I got it!

    myDescription_txt.y += Math.round((myDescription_txt.height - myDescription_txt.textHeight));
    
    328 posts
    • Has been part of the Envato Community for over 8 years
    • Has collected 100+ items on Envato Market
    • Located in United States
    timmylogue
    says

    So, by default, when you add text to a TextField, the text appears at the top, and works it’s way down to the bottom. I would like to do the opposite: I would like to have it appear at the bottom of the TextField, and move it’s way up to the top.

    I’m using the code below and it sorta works haha. The only issue i’m having is that if the text gets longer and longer, it seems to be pushing the whole TextField down and not keeping it in the same x and y position on stage. (hope I explained that correctly).

    var bottomCoord;
    
    bottomCoord = myDescription_txt.y + myDescription_txt.height;
    myDescription_txt.autoSize = "left";
    
    myDescription_txt.y = bottomCoord - bottomCoord.height;
    myDescription_txt.text = "Pellentesque habitant morbi tristique senectus" 
    

    Anyway to do this?

    328 posts
    • Has been part of the Envato Community for over 8 years
    • Has collected 100+ items on Envato Market
    • Located in United States
    timmylogue
    says

    Thanks! I’ll take a look at it.

    - Tim
    328 posts
    • Has been part of the Envato Community for over 8 years
    • Has collected 100+ items on Envato Market
    • Located in United States
    timmylogue
    says

    I’m trying to figure out how to remove a child with a specific attribute selected (filename). I have PHP displaying an XML file on a page that loads images. If someone where to click on any image or hit the delete button -

    <a href=""><img src="' . $child['src'] . '" alt="gallery image" />Delete me</a>
    

    ... it would know where to find in the XML file and delete it.



    Here what loads and displays my XML file:

    
    <?php
       $xml = simplexml_load_file('myPhotos.xml');
       //echo $xml->getName() . "<br />";
       foreach ($xml->children() as $child)
        {
            echo '<img src="' . $child['src'] . '" alt="gallery image" />';
        }
    ?>
    
    



    Here is my XML structure:

    
    <slideshow>
    <image src="myPhotosResized/image1.jpg" desc="This is the 1st image!" />
    <image src="myPhotosResized/image2.jpg" desc="This is the 2nd image!" />
    <image src="myPhotosResized/image3.jpg" desc="This is the 3rd image!" />
    <image src="myPhotosResized/image4.jpg" desc="This is the 4th image!" />
    </slideshow>
    
    

    Any help is appreciated! :D

    Tim
    by
    by
    by
    by
    by
    by