Posts by timmylogue

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

Glad your sorted, I wasnt being fa-see-shus ( can never spell it ) , but the amount of times I run the query before connection, I need punching

haha oh, I know. I do it all the time.

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

Here you go, this is the full code that I will use
<?php
// configuration
$dbtype        = "mysql";
$dbhost        = "localhost";
$dbname        = "something";
$dbuser        = "root";
$dbpass        = "mysql";

// database connection
...........

Cool, thanks again!

320 posts
  • Has been part of the Envato Community for over 7 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'];
}
320 posts
  • Has been part of the Envato Community for over 7 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!

320 posts
  • Has been part of the Envato Community for over 7 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

320 posts
  • Has been part of the Envato Community for over 7 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!

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

Thanks dtbaker! Worked!

320 posts
  • Has been part of the Envato Community for over 7 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

    320 posts
    • Has been part of the Envato Community for over 7 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));
    
    320 posts
    • Has been part of the Envato Community for over 7 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?

    by
    by
    by
    by
    by
    by