Jump to content

flash gordon

Members
  • Posts

    150
  • Joined

  • Last visited

    Never

Everything posted by flash gordon

  1. Cool guys! Thanks. I think I have what I need. Cheers
  2. hmmm...i think all of you guys are right. Perhaps I'm really just should be doing two queries or one query/sub-query. And yeah, if I'm grouping the other columns are meaningless...perhaps I should rethink a couple of things. But let me get a final answer to my question: If I use GROUP BY, can I control how other column values get flatted. For instance: <i>"SELECT assetid, asset FROM assets WHERE assetid = 1 GROUP BY id";</i> Can I control how the asset column will be flatted to make it favor specific.jpg over foobar.jpg or because I'm doing a GROUP BY, the asset colum should be irrelative? Thanks again guys!
  3. Thanks for the responses, guys. here's a table table: assets assetid | tid | name | asset ------------------------------ 1 | 0 | image | foobar.jpg 2 | 0 | pdf | default.pdf 1 | 1 | image | specific.jpg ------------------------------- The result of my query would be to return assetid 1 tid 1 if possible. If not, return assetid 1 tid0 as the default content. Make sense? Perhaps it's a bad database structure. If that's the case, please suggest a structure and perhaps give a reason as well....so I can learn and not make the same mistake again. Thanks for the attention to this. Your help and time is greatly appreciated!
  4. First off, please forgive me for not being able to find what I need on Google. I know I'm not the first person to ask this, I just can't find the answer....so I have an sql statement like so: "SELECT id, tid, asset FROM assets WHERE id IN(1,2,3) AND tid IN ($tid,0) GROUP BY id"; The problem is that my tid gets grouped in a way I don't want. Pretty much I want to be able to run a query where fetches all assets with a tid of "x" or if it doesn't exist use the default of "0". My sql groups all items into tid's of 0 and not favoring the $tid. Any idea what I need? Thank you.
  5. great? wanna explain? perhaps...if it's not a "known or reserved" /{folder_name} do the mod_write.
  6. Hello gang, does anyone know for certainity or know a good way that facebook and myspace are able to create urls like this myspace.com/{username}. I'm certain those aren't physical folders and it seems like WAY too much overhead for all of those 100s of millions of users to have mod_rewrite rules to be make those urls. So...I'm clueless to how they are actually doing it. Does anyone know? Cheers
  7. ok, point taken. We'll talk about about the best way. Maybe you or I can post one final note in this thread with the solution we come up with to benefit the community. Cheers
  8. thanks for the answer, thorpe. But that only works for directories that are already created. I need that to be the default permission for future accounts as well. Know what i mean?
  9. Okay...well it looks like I got everything solved on that end. However, I have to do this process for every client domain on the server. Is there away to declare apache as part of the group/owner on a more global level? Thanks again for all the help.
  10. ....actually 1 error still exist. I still don't have write access.....
  11. wow...that worked! I spent months and months on that. I owe you my first born. haha Ok....I suppose the follow up question. cPanel is actually creating the folder. I don't want to have to manually configure the permissions all the time. So do you know how to set this up so that so that the user account is created with the correct permissions and "apache permissions"?
  12. the current permissions are already "750." Isn't that the same? Would I run that command from putty?
  13. ok....can you give some guidance on how to make that possible?
  14. <?php echo "Getting sound1.sql<pre>"; echo exec("whoami"); print_r(file_get_contents("/home/philkc34/public_html/config.xml")); print_r(file_put_contents("/home/philkc34/public_html/stuff.txt","success")); echo "</pre>"; ?> any ideas? error message:
  15. oh yea....i got a flash application that allows user uploads from the "main" folder of "fudcake". From there based upon the user's login id, I move the file with php to their own folder. So it's going to be a continuous process of moving files.
  16. yea, I didn't think it would be a big thing either. However, I can't do it for the life of me. I'm trying to do it file_put_contents() but I get a permission denied error. I think the problem is php is running under the user "nobody" and "nobody" has no permission. That's just a guess. What else do you think is going on? Can i give you any error messages? as for myserver.com/~fudcake and myserver.com/~foo this is the way the server represents accounts on the same machine. fudcake.com and foo.com is the same thing.
  17. Hello. First off, please forgive my ignorance with this subject matter. Server side and php is not my thing. Ok...end disclaimer. Here is my situation. I have a dedicated server. The server has a user called "fudcake." Fudcake owns several other domains/users on the server such "foo", "bar", and "muckhead." I want fudcake to be able to copy or move files from it's domain of myserver.com/~fudcake to myserver.com/~foo. Now remember fudcake owns foo. Is this even possible? If so, what should be the server set up: suPHP, safe mode, chmods, etc? Thanks for your time. Cheers
  18. Thanks a bunch guys! By default I don't allow cookies to be stored on my browser. I had to turn them on and BAM! Thanks soooo much guys! Is this session data stored in a physical location on the server or is it stored in memory and clears automatically when the user closes his browser?
  19. Hi gang, Maybe I just don't understand enough php to google this correctly, but I can't find the answer. How do I make persistent session data between my pages? Here is what I'd like to do: session.php <?php session_start(); $_SESSION["name"]="bob"; echo $_SESSION["name"]; echo '<br><a href="session2.php">Next Page</a'; ?> session2.php <?php session_start(); echo $_SESSION["name"]; // should echo "bob" ?> Why doesn't the session data persistent between the pages? Cheers
  20. Wow....thanks guys! In the midst of making soo many databases and trying different stuff, I got sloppy. Sorry I can't help out around here any, but as you can see my PHP is rather bad. If you every need some flash help, come on over to AS[org] You guys rock!
  21. yea, i just didn't include the full code. If you want everything here it is: <?php //Connect To Database //$hostname='p50mysql55.secureserver.net'; $hostname='p41mysql103.secureserver.net'; $username='mycandle'; $password='******'; //$dbname='mycandle'; $dbname='Phil01'; $username='Phil01'; $usertable='your_tablename'; $yourfield = 'your_field'; $tale = "candledata"; mysql_connect($hostname,$username, $password) OR DIE ('Unable to connect to database! Please try again later.'); mysql_select_db($dbname); /** * Used for testing */ $_POST['position'] = '123,456'; $_POST['name'] = 'Julie'; $_POST['lit'] = 'true'; $ip = $_SERVER['REMOTE_ADDR']; // if only position is posted if( !isset($_POST['lit']) && !isset($_POST['name']) && isset($_POST['position']) ) { // add data to $position = $_POST['position']; $sql = "INSERT INTO $table VALUES('', '$ip', '$position', '', '')"; mysql_query($sql) or die(mysql_error()); } // if position and name is set, add name else if( !isset($_POST['lit']) && isset($_POST['name']) && isset($_POST['position']) ) { $position = $_POST['position']; $name = $_POST['name']; // find which row to update $sql = "SELECT * FROM $table WHERE `ip` = '$ip' AND `position` = '$position'"; $result = mysql_query($sql) or die (mysql_error()); $row = mysql_fetch_array($result); $id = $row['id']; // update the row $sql = "UPDATE $table SET name = '$name' WHERE id = '$id'"; mysql_query($sql) or die(mysql_error()); } // if all data is set else if (isset($_POST['lit']) && isset($_POST['name']) && isset($_POST['position']) ) { $position = $_POST['position']; $lit = ($_POST['lit'] == "true") ? 1 : 0; // find which row to update $sql = "SELECT * FROM $table WHERE `ip` = '$ip' AND `position` = '$position'"; $result = mysql_query($sql) or die (mysql_error()); $row = mysql_fetch_array($result); $id = $row['id']; // update the row $sql = "UPDATE $table SET lit = '$lit' WHERE id = '$id'"; mysql_query($sql) or die(mysql_error()); } mysql_close(); ?>
  22. Thanks guys! I got it connecting now. That's awesome! Unforntualely I have a bunch of SQL errors now that I don't get anywhere else, but it is working. yea! You guys rock. Ever need some flash help come on over to actioscript.org! If anyone see something that sticks out....let me know about this error. /** * Used for testing */ $_POST['position'] = '123,456'; $_POST['name'] = 'Julie'; $_POST['lit'] = 'true'; $ip = $_SERVER['REMOTE_ADDR']; // if only position is posted if( !isset($_POST['lit']) && !isset($_POST['name']) && isset($_POST['position']) ) { // add data to $position = $_POST['position']; $sql = "INSERT INTO $table VALUES('', '$ip', '$position', '', '')"; mysql_query($sql) or die(mysql_error()); } // if position and name is set, add name else if( !isset($_POST['lit']) && isset($_POST['name']) && isset($_POST['position']) ) { $position = $_POST['position']; $name = $_POST['name']; // find which row to update $sql = "SELECT * FROM $table WHERE ip = '$ip' AND position = '$position'"; // <-- error here? $result = mysql_query($sql) or die (mysql_error()); $row = mysql_fetch_array($result); $id = $row['id']; // update the row $sql = "UPDATE $table SET name = '$name' WHERE id = '$id'"; mysql_query($sql) or die(mysql_error()); }
  23. Oh, I agree. I'm was just doing some flash work and was forced to use GoDaddy. Is this what you mean: MySQL Database InformationStatus:SetupHost Name:p41mysql103.secureserver.netDatabase Name:Phil01 Database Version:4.1 Description:Not SetUser Name:Phil01 Does that tell you anything?
  24. I tried calling them and they said they offer no support for their hosting packages. They wont tell me what that first param should be and I don't know how to find out. Additionally, I don't even know if that IS the problem or not as my php experience is rather limited. I don't know what to do.
×
×
  • 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.