Jump to content

jeff5656

Members
  • Posts

    744
  • Joined

  • Last visited

Everything posted by jeff5656

  1. Looks like my post got moved to the dark black hole of "miscellaneous" thus dooming it's potential for anyone to read it. If a tree falls in the forrest will anyone hear it other than the forum admin? Ok, on to Google...
  2. As everyone here knows, the word "field" applies to the field in a database table (like last_name, dob, etc). But for the layman (or casual web surfer) what do you call the field. For example, "Click here to rename the fields". But most people don't know what a field is, so what do you guys use as a synonym?
  3. So I can have a php page inside a public directory that includes a file from an htaccess-protected directory? And the public user will be able to read that included file, but if they try to access it directly from the protected directory they will not be able to? (That is what I am hoping).
  4. If you use htaccess to restrict a directory can you still use the include function to include a file from that directory?
  5. never mind, that worked. I just had the wrong field name.
  6. I tried this but got an error: $query = "select * from dos WHERE month(billing_level) = '04'"; the field is billing_level. I got this error: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource
  7. I have a date field. How do I select all records from last month (in this example it would be all records from April). Something like $query = "select * from table where date_field = last month" Thank you! And moderators: aren't you proud of me for posting this here instead of php coding help? :-)
  8. In a text box I put in some code snippets that I want to refer to later, but when I display it, it displays it in html. How do I convert the code into pure text so it displays the actual code? If I try strip_tags, that just strips it (and it doesn't work with php). And I can't use strip_tags with conditions, because I don't want to list all codes! Also, the code has both html tags and php code - I just want that whole thing to be displayed as is, without havign the browser try to "read" it. Also if I put this into the text box, <td><?php echo date ("m/d/Y", strtotime($row['code_date']));?></td> then nothing is displayed. If I put this in the box: <input class="button" style="display:inline" name="whatever" type="submit" value="Press here" /> then I get an actual submit button instead of the code!
  9. And thank you to fugix too. I appreciate your help. :-)
  10. Here are my tables. Can anyone fgure out why I get that error message? CREATE TABLE IF NOT EXISTS `news_read` ( `id` int(10) NOT NULL auto_increment, `user_id` int(10) NOT NULL, `news_id` int(10) NOT NULL, `signoff_status` enum('a','s') collate utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) ) --- CREATE TABLE IF NOT EXISTS `news` ( `id` int(10) NOT NULL auto_increment, `news_date` date NOT NULL, `news` text collate utf8_unicode_ci NOT NULL, `group_type` varchar(20) collate utf8_unicode_ci NOT NULL, `institution` varchar(30) collate utf8_unicode_ci NOT NULL, `exp_date` date NOT NULL, `signoff_status` enum('a','s') collate utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) ) CREATE TABLE IF NOT EXISTS `users` ( `id` int(20) NOT NULL auto_increment, [snip] `field_name99` varchar(60) NOT NULL, PRIMARY KEY (`id`) )
  11. When I do that I get this error: Not unique table/alias: 'u'
  12. ugh.. fugix was really helping me out when the thread was moved. I doubt he knows to look here. Couldn't you guys have moved the thread AFTER he answered my question?
  13. The plot thickens. Here's the error: Not unique table/alias: 'users' But the name of my table is users, and there is no other table called users...
  14. Hmm, I thought I found the error but this doesn't work either:
  15. it's just this: (is that what you're asking? I just put it into a while loop. $results = mysql_query($query); while ($row = mysql_fetch_assoc ($results)) {
  16. I want to join 3 tables. The records are linked by id. news_read has a field called users_id which links to the users tables. I get "Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource" here's my 3 tables and the way they are linked by id USERS NEWS_READ NEWS id --------------------> user_id news_id ------------------------>id
  17. "basename() does exactly that!" Obviously basename only works if it's a subdirectory, so I just wanted to know how you would solve this problem more generically. Iended up using basename solution because it was a directory, but for instance how would you use regular expression to exclude everything between the characters / and /. Or maybe the / is confusing. How would you convert this: **hello##goodbye to this: goodbye. Wouldn't you use regular expression for this (and word length varies so you can't use substr) . Also, as someone alluded to I never meant to question people's knowledge here! This is the forum I come to for answers. You guys are *brilliant* and I am constantly amazed at how quick the solutions come back (sometimes in under a minute).
  18. That works for this particular example of a directory, but doesn't do it with reg expressions so I guess I will have to learn that another day :-) Looks like based on no response (and a link to substr tutorial), it looks like *others* have difficulties with regular expression too. :-)
  19. Well the problem with that function (if I understand the link you gave me - forgive me if I am wrong) is that you need to know how many characters there are. The subdirectory name changes, so that won't work. it could be /direct1/hello.php or /example999/hello.php I just want in any of these cases to arrive at hello.php. I was under the impression that you use regular expression to do this.
  20. Sorry, I tried to understand the regular expressions but can't figure out the following. How do I take this string /direct1/showtable.php and make it showtable.php. In other words strip out the /direct1/ Once I see how this is done I can apply it to other examples. Thanks!
  21. That didnt work. When i echout out NewString I got the original string: table.birthday When I echoed out $position, it was blank.
  22. Can someone help me with this. I think I need to use substr: how do I only echo out everything after the period ( ".") for example if I have "table.birthday" I want to echo: "birthday"
×
×
  • 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.