Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. select your survey table from the list of tables, and at the top where it says * Browse * Structure * SQL * Search * Insert * Export * Import * Operations * Empty * Drop click the SQL tab. There should be a huge textarea box labeled "Run SQL query/queries on database <database name>: Put the query string in it and on the bottom right, click the "Go" button.
  2. okay so go to phpmyadmin and run select s.* from survey as s, completed_surveys as c where s.id != c.survey_id
  3. I'd recommend going for the dropdown option, but just to answer your question, you can do something like this: insert into table1 (column) values ((select column1 from table2 where column2 = value))
  4. No I mean, where did you set it up? When you created your tables, that's the code, but how did you give the db that code? From a command line? Through phpmyadmin or some other interface? by using mysql_query in a php script?
  5. how did you setup your tables in the first place?
  6. would help if you provided login info to a test account that has surveys completed.... also, did you try putting the query directly into the db from command line or phpmyadmin?
  7. select s.* from survey as s, completed_surveys as c where s.id != c.survey_id edit: oops you said NOT so query string changed to !=
  8. In your code, I see you using 3 different names in different places: $_FILES['uploaded'].. $_FILES['userfile'].. $_FILES['uploadedfile'].. Well what did you name your file input field in your form? It's really simple: If you have a form with a file upload input field and you name it "blah" then you use "blah" not "someothername". Posted examples are just that: examples. You need to put your own var names into it.
  9. Okay well if it's admin only, check out my tutorial.
  10. Okay well as far as the database is concerned, you can do something as simple as storing a few numbers associated with each available module position. Are you wanting this custom sorting to be something only an admin can do, or is it something you want each user to be able to do as their own custom layout?
  11. Once again, try using the correct variable name in your condition. You're checking $_FILES['userfile']['type] and that doesn't exist.
  12. btw $string = '<a href="http%3a%2f%2fwww.hello.com">'; $string = preg_replace("/%3a%2f%2f/", "://", $string); works fine for me.
  13. any reason you can't do echo urldecode($string); ?
  14. Maybe it doesn't work because $uploaded_type doesn't seem to exist (as in, you didn't assign anything to it) $_FILES
  15. The dragging and dropping would be done client-side with javascript. There are several frameworks out there that make it easier to implement (like jquery). Updating the order can be done in "real time" using ajax (again, you can use a framework to make it easier, like jquery). Do a search for custom sort order/custom list order/custom drag and drop list order. I wrote a tutorial that shows the basic principle, but it's strictly php, no drag and dropping, etc.. so I'm not really gonna point you at it.
  16. only one way to find out...
  17. You mean like this? <?php function foo() { // do something } function bar() { foo(); } ?> or this? <?php class something { function foo() { // do something } function bar() { $this->foo(); } } ?>
  18. http://www.google.com/search?hl=en&q=nes+rom+mime+type&btnG=Google+Search
  19. You can keep the logged in status saved in a column in the db and in your login script, not only check user/pw, check login status. If it's currently set as logged in, give message saying you can't login. Set status to logged off if user logs out. If user doesn't log out (just closes the browser or whatever), you can also have a column that shows timestamp of last request from user. Setup a cron job to set status as logged off after x amount of time. Some people have those columns as part of the user account table. Some people use a separate table to hold currently active sessions. If you have a large user base, I'd go for the 2nd option.
  20. oh, I thought you were asking for an icon to be added to the list of icons you can click, for the already existing [ php ] .. [ /php ] tag. To that, I would point you to smf's suggestion board.
  21. why don't you try putting an 's' in your $roll_no string $roll_no = "hello 12343 hello$%#% ssss";
  22. s represents 's' \s represents a space. <?php $patterns = array('[^\d]','[^0-9]','[^0-9s]','[^\ds]','[^0-9\s]','[^\d\s]'); $string = "aklsdj sldkj 23 0j0j23 0392sd0n iss230i ssss"; echo "<pre>"; echo "<table>"; echo "<tr><td>subject-></td><td>$string</td></tr>"; echo "<tr><td>pattern</td><td>result</td></tr>"; foreach ($patterns as $p) { echo "<tr><td>$p</td><td>" . preg_replace("/{$p}/", "0", $string). "</td></tr>"; } echo "</table>"; echo "</pre>"; ?> output: subject-> aklsdj sldkj 23 0j0j23 0392sd0n iss230i ssss pattern result [^\d] 00000000000002300000230039200000000230000000 [^0-9] 00000000000002300000230039200000000230000000 [^0-9s] 000s000s0000023000002300392s00000ss23000ssss [^\ds] 000s000s0000023000002300392s00000ss23000ssss [^0-9\s] 000000 00000 23 000023 03920000 0002300 0000 [^\d\s] 000000 00000 23 000023 03920000 0002300 0000
  23. \d is shorthand for [0-9] and why is that 's' in there? your [^0-9s] pattern will replace anything that is not a number or 's' with 0 so if you have this: abcs123 you will get this: 000s123 [^\d] will replace anything that is not 0-9 just the same. If it didn't work then you messed up somewhere else in your code.
  24. use [^\d] instead of [^A-Z]
×
×
  • 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.