Jump to content

Morg.

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Morg.'s Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I did expect that answer and explanation tbh, but I think this is more an issue of rules & respect (i.e. if you post in the wrong forum because you don't read the rules (oops did I just say that) -> warning + move, second time delete) and that kind of stuff - Quite honestly I won't be around for long anyway but this drags the forum towards more traffic and less advanced subjects -> less advanced audience -> ... Not my forum but hey, thought I'd just share this
  2. Hello, I only recently registered to this forum and posted a few help messages while I was there. And really quickly it became clear to me that there is such a mix of everything in this forum that it becomes less efficient. How about partitioning the PHP Coding Help in at least three levels : - basic (for all the simple stuff like "I forgot to set my variable", "how do I if/then/else" and "I can't connect to MySQL) - medium (bit more advanced, but no basic debugging) - advanced ("how do I go around this function's limitations","why is my utf8 strlen failing?", etc.) In that way I believe the following will happen : 1. There will be much more correlation (i.e. the next noob that comes in with "a why is my variable undefined ?" will most certainly find another topic saying exactly the same thing 2. More local stickies (i.e. "variable undefined : how to") 3. Better use of resources (I honestly don't want to post "RTFM" or "OMG" in every basic question post, however I'd be really happy to help people with what I consider "real" problems (i.e. those you can't fix with 5 minutes of googling) 4. Less clutter, more readability (yeah you know, that request I helped on yesterday which is now on page 7 of the forum -- ) Speaking about stickies, cross-linking problems would be a good idea (or making clear stickies summarizing the most frequent problems) -- Just my 2 cents as always, but I think this change is both easy and useful for you guys
  3. You might want to include the code generating the "1 is blank" and stuff because this is quite cryptic right now --
  4. yeah .. smileys don't help in code either -- ALTER TABLE whatever CHANGE id id int( PRIMARY KEY NOT NULL AUTO_INCREMENT; There you go. And if you are not good in databases, take the time to learn a bit, it's worth it as you seem to be working with one.
  5. As the man said .. plus it'll be cheaper than asking someone who knows what they do
  6. As thorpe said, there isn't any real reason to do that anyway -- and the page not found error does not come from PHP, it's apache that sent it because the referred URL did not match anything.
  7. Seriously ... UNDEFINED means that variable is not SET. YOUR code checks for files[name] AND for files[name] ... I have quite a doubt both would be set --
  8. .htaccess files or httpd.conf , read up documentation from Apache --
  9. -- if your id is indeed an int(, else modify ALTER TABLE whatever CHANGE id id int( PRIMARY KEY NOT NULL AUTO_INCREMENT;
  10. Ow ... err you should ask someone to take a look at the script, forcefully killing scripts from outside with no idea of the current state is definitely a bad idea, might as well not run them at all if that is the case. Otherwise you can surely setup a shell script ran through cron that would use top output and a perl regex to find the process running your script and its running time and then based on that issue a kill PID // still a very bad idea but that should work.
  11. I don't understand it either and I use regex every day, use google, type regex, read up and translate. GL.
  12. Yes, correct the code instead of resorting to mad workarounds (hey this script is doing random stuff, let's make another broken script to kill it erratically...)
  13. This could not work .. your $cats is defined only inside the foreach loop <?php $cats_upload = ""; $cats_sql_match_string foreach($_POST['module'] as $cats) // errors if no modules are selected { echo '<p>Module data moduleID: '.$cats.'</p>'; $cats_sql_match_string.=$cats.","; } $cats_sql_match_string=substr($cats_sql_match_string, 0,strlen($cats_sql_match_string)-1); // the mysql extension to PHP is full of problems, you might want to switch to mysqli // you might also want to centralize all your queries into one function query($stuff) in order to avoid maintenance nightmares (as in switching from a db extension to another) $sql = mysql_query("SELECT * FROM modules WHERE moduleID IN'".$cats_sql_match_string."'"); // Besides, executing a query with potentially no $cats at all is not a good idea, add some checks for that $productCount = mysql_num_rows($sql); //count the output amount if($productCount > 0){ while($row = mysql_fetch_array($sql)){
  14. Well I don't know what you're attempting to do but this sounds fishy anyway Whatever the purpose, you should not be storing field_whatever data in SQL when you can have much simpler more maintainable solutions.
×
×
  • 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.