Jump to content

Asheeown

Members
  • Posts

    471
  • Joined

  • Last visited

About Asheeown

  • Birthday 12/05/1991

Profile Information

  • Gender
    Male

Asheeown's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Works perfectly, thank you very much.
  2. That regex sends back an empty array when using preg_match_all. I tried with the example I posted as well and it's the same thing.
  3. I'm making this simple parser that has turned out to be not so simple. Phrases/sentences are encased in apostrophes and parsed but when they CONTAIN apostrophes, slashes are added before it is parsed. For example, if someone entered the sentence (It's a sunny day today.), the output would look like this: 'It\'s a sunny day outside' I add the apostrophes manually on the outside to separate sentences but addslashes before that to escape any existing ones so far. However, my expression below just doesn't cut it, and I can't figure out how to skip over any apostrophes that have the escape character in front of them. $regex = "/'(.*?)'/";
  4. I'm working on a new project and this is a feature I've always wanted to implement. An auto-updating activity table. It will be shown at the top of each member page to show new 'posts' or whatever and it will refresh say every 10 seconds. I wanted to have records fade out on the bottom as new ones faded in. I can fade in and fade out records, I can also create new rows in the table with data coming from the ajax php request. For fading the table rows I use the following code: function ShowHideTableRow(rowSelector, show, callback) { var childCellsSelector = $(rowSelector).children("td"); var ubound = childCellsSelector.length - 1; var lastCallback = null; childCellsSelector.each(function(i) { // Only execute the callback on the last element. if (ubound == i) lastCallback = callback if (show) { $(this).fadeIn("slow", lastCallback) } else { $(this).fadeOut("slow", lastCallback) } }); } and to execute: ShowHideTableRow("#" + tbl.rows[6].id,false,function() { }); That would hide row 6 in 'tbl'. Thing is I'm severely confused. I'm not sure how to maintain a list of whats supposed to be there, or what gets switched out, what stays, what fades. I've just been butchering everything I code and I've been stuck for three days. If anyone else has done this could they point me in the direction of the code they used or the techniques they used to code it.
  5. Absolutely, and I figure designing and testing the structure of each will give me a nice final solution in the end. Maybe even a new combination of sorts. Well, I'll just have to find out.
  6. When I first read that I was like "crap, wish I knew if it was a sure more efficient way to do this." But this is actually a good opportunity. I'm going to create a structure for two methods, yours and creating a table for each log book. Then I'm going to make a script to create a few hundred log books in each and start populating them with thousands of rows. Then I'll run a stress test script against both my webservers and see each reacts to the processing loads. I think querying one table for all log entries might start to bog the query result speeds but I also think too many tables will bog MySQL in general so we'll see how it comes out. Thanks for the suggestion. I'll mark this as solved and most likely post my results when I'm done for future reference.
  7. fields (field_id, field_log_id, field_name, field_type) logs (log_id, log_name) fields_values (log_id, value_field_id, value_value) insert into logs (1, 'Walk The Dog'); insert into fields (1, 1, 'Location', 'String[200]'), (2, 1, 'BathroomStops', 'Integer'), (3, 1, 'FirehydrantsSeen', 'Integer'), (4, 1, 'GoodExercise', 'Boolean'); insert into fields_values (1, 1, 'Pittsburgh'), #Location (1, 2, '3'), #BathroomStops (1, 3, '15'), #FirehydrantsSeen (1, 4, 'False'); #GoodExercise Just left out the log ID in the field values table. So you think this would be an efficient method of doing this even with say 200 log books and around 20-50 entries a day on each?
  8. I'm making a log book system and I'm in need of a good dynamic fields idea. In this system a user can create a new log book. In that creation I want him/her to be able to specify custom fields for the logs in that book. So for instance if I was making a log book on when I took my dog for a walk, I might want the following fields: * Obviously joking in most of these My first choice to myself was new MySQL tables for each book. Just take the fields they entered with a data type and create a new table for that specific log book. My second choice was to create tables that the data would be stored in with an abundant amount of columns. For example, 20 or 30 columns, so when the user entered the fields they wanted I could have a definitions table telling me which column did what. The more I go on about this is, it seems like a MySQL question, but in reality PHP will be determining what fields to show on the screen and so on. So really I'm looking for a simple efficient solution, no code, just the idea.
  9. Where is your secured page getting all of its variables? $username, $row? The order of your pages doesn't make sense and none of them link together. I see you set a cookie after logging in and then the user data in session variables in the secured page, but if the secured page doesn't know where to get that information it can't set it.
  10. <?php $q = ("UPDATE listings SET location='$location', company_name='$company_name', editor1='$editor1' WHERE id = '$id'"); $result = mysql_query($q) or die("<b>A fatal MySQL error occured</b>.\n<br />Query: " . $q . "<br />\nError: (" . mysql_errno() . ") " . mysql_error()); ?> As long as you populate $id with the correct listing id before this statement now it will update the specific record.
  11. You need a MUCH MUCH better way of verifying your licenses. Send it to a PHP page and have it verify against a database with string sanitization going on. ANYTHING will be better than that. Seems like you need to focus on that before you actually go locking down the code with this license page. Encrypting each page against formula that's made to generate the license codes is your best bet. This way license codes generated from the formula will be able to decrypt the code and allow it to run.
  12. Post the error. EDIT: If a blank screen is showing, turn on errors for PHP temporarily, even just to see this.
  13. $count1 = count($large_images); $i=0; while($i<$count1) { mysql_query("INSERT INTO images (image, thumb, when_up, who) VALUES (" . $large_images[$i] . ", " . $small_images[$i] . ", '$when_up', '$by_who')"); $i++; } That should work just fine
  14. Okay, so you guys were right. The equation I gave you has no solution. Problem is it isn't the real equation. While transcribing it to me, my friend mistyped one of the letters in the equation. Here are the actual two equations: A * (BC) = (DEF) = (HK) * G H * (EC) = (DBG) = (AK) * F I bolded the incorrect letter. This set of equations yield two answers: AND Sorry about the confusion guys. I knew something was wrong, the script averaged about 500 million attempts per 12 hours, and it was running for days without posting an answer. I found these new answers in less than 10 seconds a piece.
×
×
  • 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.