Jump to content

gizmola

Administrators
  • Posts

    5,945
  • Joined

  • Last visited

  • Days Won

    145

Everything posted by gizmola

  1. I think you might find based on your criteria that this is a good start: http://www.amazon.com/jQuery-Novice-Ninja-Earle-Castledine/dp/0980576857 The problem with any book about jquery, is that you need to have a decent working understanding of html and css for things to really make sense. If you're unclear on those, you might need to put in some study time to get the most out of the book.
  2. Again the purpose of the key is to provide uniqueness, and to facilitate joins to other related tables. It is not a counter. With that said, what you can do is: -reset the auto_increment counter for the table to 1 -drop the column -re-add it You can run these commands in the mysql client or use the sql panel of phpMyAdmin, or whatever mysql admin app you might be using. alter table yourtable auto_increment = 1 alter table yourtable drop id alter table yourtable add id int unsigned primary key auto_increment first
  3. That's about as clear as mud. Where is your result set variable? Are you doing this inside a fetch loop? Is your goal to filter results by those columns? I'm just guessing because your explanation of what you want is really bad, which is why you have gotten no responses other than mine. I'm going to just take a swag here, because I'm practically clairvoyant after 10 years of answering questions here, and guess this is close to what you're after: // You did a mysql_query like SELECT * FROM sometable WHERE somecol = 'something' // $result = mysql_query.... while ($row = mysql_fetch_assoc($result) { $rows[] = $row; } // Filter into 2nd array $stallions = array(); foreach ($rows as $row) { if ($row['age'] == 0 && $row['gender'] == 'Stallion') $stallions[] = $row; } // Now you have filtered rows in $stallion var_dump($stallions); In the future, when someone here, especially with a badged account tells you that your question is not clear, I'd advise you strongly to go back through your question and try and clarify it.
  4. This line: $array1 = array($name); doesn't make much sense in this context. The array() defines an array. I'm not sure what $name is suppossed to be here.
  5. You could but I doubt you'll have much luck with that. This is why places like phpfreaks and stackoverflow exist -- to help people navigate and seek advice.
  6. Add an ORDER BY gameid to your query and you'll get the rows in that order. Your script simply needs to loop through the result set checking to see if the $gameid changed, and setting a boolean based on finding 2 records for that gameid (home report and away report). Whichever one is read first is your baseline. If any of these conditions occur: - Only 1 report - Scores don't match Then you generate the report.
  7. neven, 'htdocs/store' is not the real path to anything. That is a relative path. It will only work if the script that is running that code has a subdirectory of htdocs. If you don't have a / at the front of the path it is a relative path. Also, it appears you testing this on a windows machine, and the directory seperator for windows is different from unix. That is why I suggested teh use of self:FOLDER_SEPERATOR. This is really a simple concept, and if you don't understand it, you are not going to get this working. At this point, I don't have any other suggestions for you -- perhaps you should pay someone to get it setup for you, because really, anyone who understands the idea would be able to get this working with very little effort. I'm not getting enough information from you to continue to try and debug it for you, and this isn't really of value to the community at large, because you are trying to modify a script that was written by someone else for your own purposes, and those purposes aren't really clear.
  8. You might try this: define('FILE_ROOT', 'store' . self::FOLDER_SEPARATOR . $variable); However, the FILE_ROOT must be a path to a directory that apache has the rights to. It's about as simple as it gets. I don't think there is any point in my continuing to repeat the same thing in this thread.
  9. I have also tried to put the directory in front of the variable: define("FILE_ROOT", "store/".$diro."/Folder"); But then it say "store/65465/Folder is not a directory " ???????????? I'm confused :S You can not use a relative directory there "store". You need to provide a real path -> "/some/path/store".
  10. The code looks clear and functional. The important thing is that you understand it, and that you'll be able to maintain it and update it as needed.
  11. Your description is accurate, only it is important to note that store_result does not need to be called. If it is, yes it stores it in a variable, but not one that is accessible from php in anyway. It's memory used by the mysqli client routines invisibly. If you do want to use the num_rows, then you do need to use buffered mode. As for "bind" variables, I think it's helpful if you think about them as a contract between your script and mysqli. "Binding" a variable simply sets things up so that the php variable name is "bound" to a particular column. After you do that, everytime you fetch the client will put the value of the column for that fetched row into the bound variable. This can be a really confusing concept for people use to the original mysql api. It is also not something you *have* to use as there are routines like mysqli_fetch_row or mysqli_fetch_assoc you can use instead.
  12. As far as I can see, if you have a variable that contains the path to the user's home/base directory, then setting that in the define will work. It needs to be the full path to that directory however.
  13. In general programming terms a "buffer" is an area of memory that is utilized as a temporary storage location to help with performance by limiting the amount of work required to get one piece of information. In this case -- fetching one column or one row from the result set. This might be a good thing, or it might be a bad thing, especially if the result set is very large and you will typically only fetch a few rows, although in that case, you'd probably want to use LIMIT in the query anyways. If you utilize mysqli_stmt_store_result($stmt) then all the result set data is buffered in the php script . This is only important if you're planning to use mysqli_num_rows(), because it will not return the result number if you do not first call the store_result method. If you are not going to use mysqli_num_rows(), then fetching the data unbuffered is probably not going to be any slower. In summary, the answer to your question is, that store_result() is a mysqli utility function that "buffers" (fetches the result set data into an internal php variable) which will be subsequently used by when fetching data. If you do not call it, fetching will still work.
  14. I see you posted more code, but I don't have time to look through an entire class. Try my suggestion and see if that fixes things, as I think it might.
  15. Ok, well I can see the intention of these constants is to use either a db or some filesystem based storage. Since you're using filesystem storage it appears that define("FILE_ROOT", "store"); Needs to be the directory path to the place where whatever is being stored, will be stored, you need an actual operating system specific path -- something like: define("FILE_ROOT", "/home/someuser/public_html/store"); I have no idea what this variable should be, and this is based on the assumption this constant gets passed to constructor for the object of whatever class you partially pasted. If that assumption is correct, then this needs to be a real path, and not just some relative variable like "store".
  16. You have not provided enough of a description of your problem nor enough code to understand what is going on. One thing I can tell you: define("FILE_ROOT", "$diro"); The quotes do nothing helpful. define("FILE_ROOT", $diro); Would be the right use. If you are hoping that this will act like a macro -- that is not how define works. It creates a constant at the point that define() is called, so FILE_ROOT will be set to whatever the value of $diro is. I'm not sure how that figures into your problem or the rest of the code that you didn't provide.
  17. Yes it's certainly possible. Take a look at explode as an example of a helpful function. I personally do not advise people to do sql queries with LIKE '%someword%'. Any like query with '%....' is unable to use an index, which means that in order to execute your search it needs to look through every single row in the table and check for a match. As your table gets larger and larger, the search will get slower and more resource intensive. If however, the table is not that large, and can be kept in memory most of the time, it may be alright for your site. There are alternatives -- mysql has fulltext search which can be used, and many people use alternative document indexing like the sphinx engine. It is also possible to build your own efficient search table, that breaks up a sentence into a list of all relevant words (you want to exclude punctuation, common nouns and conjunctions, etc.) and store these in a "keywords" table. You make a many to many resolver table between this table and the original table, and you'll have an efficient solution to searching for any number of words that doesn't require the use of LIKE '%word%". I mention these options so you can take a look at them, but the plain and simple answer is that you can explode the search string into an array (although again you want to strip out meaningless words) and create a like query with: LIKE '%word1%' OR '%word2' OR... etc
  18. Mr. Blogger: I don't know what your problem is, but cssfreakie is one of the most helpful and knowledgeable css/html developers we have in this community. Your comments and reaction to his attempts to help you in this thread were ridiculous, and then you actually wasted even more resources by reporting him for doing so. Please do us a favor and don't bother coming back anymore, unless you can adjust your attitude.
  19. I have no idea what that string format is suppossed to be. My SPF is setup as txt records in dns for the domain. If you have a typical domain with one mx server for that domain, then you need an spf for the domain: yourdomain.com. IN TXT v=spf1 mx -all This indicates that your mx servers will send mail. Then for the mx record for your servers, you should have an spf specific to each. Assuming I just have 1 mx, the dns record is: mail.yourdomain.com. IN TXT "v=spf1 a -all" You can test the validity of your spf records using: http://www.kitterman.com/spf/validate.html
  20. Mysql transactions only work if all the tables support transactions. Typically people use the innodb engine for this. However, transactions would only be part of the solution, because you also would need to place a lock on the player row using SELECT ... FOR UPDATE. Transactions only insure that all your changes are completed. They won't prevent one session erroneously overwriting the data of a previous session. This is extremely hard to test, but with your code you could have 2 sessions select the same opponent -- the first session would insert into game, then update the player and end the transaction. The 2nd session would insert into game, and update the exact same player that is currently assigned to the 1st game, overwriting the other sessions's update. A transaction does not prevent this -- only a lock will.
  21. gizmola

    NOW()

    I think fenway is just pointing out that the mysql date functions will do some strange things when dealing with invalid dates, and this isn't necessarily documented. I've done a lot of looking at mysql date handling and what I found is that mysql comes in a mode where it will accept invalid dates in many cases. This is actually by design, and can be reconfigured in the latest version of mysql. For example, you can store a datetime that has zeros in it, or a valid year and invalid month/day or any variation. You can now change the configuration of mysql so that it does not allow invalid dates, but that is not the default, nor have I personally played with the setting. In this particular case, the point is moot, because the parameter NOW() will always be valid. One other thing about DATE_SUB, is that it is fairly new function, whereas DATE_ADD has been available for a long time. You can achieve the same effect with DATE_ADD by passing negative interval values ie. (INTERVAL -30 SECOND), and I always use DATE_ADD for that reason. In conclusion: the OP has not been seen in this thread for a while. I never got an answer on whether or not the column in question is a datetime, an integer or a mysql timestamp. That is an important piece of information. Regardless, he seems no longer to care about this thread, so let's let it go off to sleep.
  22. In the php.ini you need to look at these settings: upload_max_filesize = 100M post_max_size = 101M max_input_time= 300 In this example, I'm suggesting you start with a setting of 100m and test uploads of files around the 95m range. Once you have success you can start upping the limits, using larger files and rechecking. post_max_size must always be a bit larger than upload_max_filesize, and max_input_time needs to long enough (in seconds) for the upload to complete. Depending on your upstream, for an 800m file, this may need to be significantly increased. The question of LimitRequestBody is based on your apache configuration. If there is a config file being loaded that has imposed this restriction then you need to find that and adjust it upwards. Check your httpd.conf and any directories or files that are being included. If you have mod_info setup on your server, you can check the current settings and determine where configurations are set, but I doubt that LimitRequestBody has been configured. If you're unclear on mod_info, do a search of the httpd.conf for it. You might need to tweak it in order to access the page from your IP, even if it is turned on. Often it is available but commented out. When enabled you can open http://yourserver/server-info, search that for LimitRequestBody and you'll probably find that it's: 1036: LimitRequestBody 0 : Which in this case is showing that a particular vhost on my server has this setting configured to be 0 (no limit) and that this setting was made in the httpd.conf file at a particular line. So another way to be sure this is turned of would be to go to the virtualhost section for the site in question and add it to the bottom: LimitRequestBody 0 If you go through the server-info and there is no explicit setting of the variable, it is at the default of 0.
  23. Ok, you want 2 different RewriteCond/Rewrite Rule pairs. Start with the specific one for the upload. When that is matched, use your existing rule. If it is not matched, processing will fall through to the 2nd Condition/RewriteRule. In your 2nd rewrite rule, just omit the &special=$2 portion.
  24. I guess the way I wrote that last reply, there could be some confusion. The way you originally phrased the question, "Cloud Software (Applications)", there isn't any difference between SaaS and "Cloud Software". SaaS runs in "the cloud". The Cloud is just a buzzword that has no set meaning. When people talk about "the Cloud" it can mean a lot of different things. If you really want to try and find a distinction, I guess you could say that "Cloud Software" is software that stores its data "somewhere else" using the internet. But as I pointed out earlier, so does SaaS.
×
×
  • 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.