-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
You can't. That's the standard. If you really want to store it in your own format, you can use a different field type, like varchar, and store it as a string. But then you are going to run into issues when you later on want to go back and do things like only select things between date ranges, etc... My advice to you would be to keep it as-is in the db and you can reformat it when presenting it to the user. The db has built-in functions to reformat it in your query when you are selecting the data. Alternatively there are php functions such as date and strtotime to help you reformat it. Alternatively, since it's simple yy-mm-dd you can just explode at the hyphen and concatenate it back together in your desired order.
-
[SOLVED] user validation always displaying invalid ? please help
.josh replied to Jnerocorp's topic in PHP Coding Help
ah okay I was making sure it wasn't an int or bool type because "true" != true but I see your issue: $validation = mysql_query("SELECT validated FROM `members` WHERE `username` = '$username'") or die(mysql_error()); $validation is a result source, so you are comparing $validated to a result source. You need to use mysql_fetch_array to get the value of `validated`, just like how you did when comparing the passwords -
hmm... it makes no sense that this: $source .= $result; would work, but changing it to this: $source .= urlencode($result); would somehow make an extra url in there. Are you sure you didn't change anything else?
-
[SOLVED] user validation always displaying invalid ? please help
.josh replied to Jnerocorp's topic in PHP Coding Help
I didn't ask you what values you had in your table. I asked you what the field type is. -
String concatenation. $dd = "12"; $mm = "10"; $yy = "2009"; $dateString = $yy . "-" . $mm . "-" . $dd; edit: from above post, yes, you got it right, though with php it's . not +
-
[SOLVED] user validation always displaying invalid ? please help
.josh replied to Jnerocorp's topic in PHP Coding Help
You said `validated` can be "true" or "false"; what field type is `validated` in your table? -
In you opinion, what do you think is the most "badass" built-in php function? Like..."Holy shit I didn't know there was something out there for xyz, I somehow feel like I just learned a new kung-fu move! <swipe hands in air pretending you really know kung-fu>"
-
[SOLVED] remove [square brackets and contents] from string
.josh replied to andyd34's topic in Regex Help
in javascript it is the equivalent of preg_match_all vs. preg_match not that this is supposed to be a js solution...just sayin', that's prolly where he was coming from. -
[SOLVED] remove [square brackets and contents] from string
.josh replied to andyd34's topic in Regex Help
Why don't you try running that through this string and see what happens: -
thread locked.
-
..and i think that's what your problem is. In the one you listed that works, you are passing it as an argument.
-
I see a return in there. That means you're in a method or function. And you are using $conDB. Is this set outside of the function? You do not need to assign mysql_connect to a variable. But if you do, it is not automatically (super)global. You can probably remove it from mysql_query in your function and php will try to use it automatically. If that don't work, put global $conDB; inside your function.
-
you said you have another mysql_query that works. Is it in the same script as this one? I'm wondering if you failing to connect to the db in the first place.
-
Coughs strtolower OMG WUT SORCERY IS THIS???!?!?!?ONE11!!?!?!
-
let me tell you, ever since i made this thing, i have to beat the ladies off with a stick to keep them away from me, fuckin' throwin' themselves at me and shit.
-
[SOLVED] Using the word PHP in a PHP Application
.josh replied to Liquid Fire's topic in Miscellaneous
but we're talking about using a copyrighted name as part of the name for his program, not the program itself. -
yeah...for profile avatars you shouldn't really be resizing it every single page load...you should have it permanently resizing when the user uploads it in the first place.
-
I'M NOT ENTIRELY SURE WHAT YOU'RE GOAL HERE IS BUT OFFHAND I THINK YOU MIGHT WANT TO LOOK INTO EVAL
-
[SOLVED] Using the word PHP in a PHP Application
.josh replied to Liquid Fire's topic in Miscellaneous
I'm not a lawyer but I'm pretty sure that if your script is using php to run that constitutes as "deriving from the software" While I may somewhat possibly agree with Dan that technically if you made your own compiler using the same syntax you might possibly get away with it, but a) I'm not so sure you would get away with that, b) that's not applicable anyways, as clearly that is not the case here. -
Start with a single table with IP, url, and timestamp. Every time someone goes to any given page, simply insert that info into the table. Then you can go back and build reports based off the data in that table. You can select distinct whatever, group by whatever, count whatever, etc... depending on what you want to know (top 10 urls by hits, whatever)
-
well there are different "levels" to generating an image "on-the-fly". Typically you generate an image resource. imagejpeg outputs an image either to the browser or to a file. When you output it directly to the browser, it requires the image header, since you are outputting a raw image. If you want to be able to place it anywhere on your page, you're going to have to output it to a file and then use a regular html img tag pointing to that file.
-
I admire your willingness to learn but it's kind of hard for me to know where to point you when I don't really know what your current skill level is. Do you already know how to do basic database interaction (setup a table with some columns, use php to insert/select stuff, etc..)?
-
well, not complicated per se...but it could very easily snowball to the point where you have to stop and ask yourself why you're reinventing the wheel.
-
dude... most people don't even think the zend certification is worth a damn, and that costs a hell of a lot more than $75 and is made/backed by the people who made php itself...
-
you need the g modifier