-
Posts
1,008 -
Joined
-
Last visited
Posts posted by spiderwell
-
-
i would use one sql statement and with my statement have the variables default value as NULL and only fill them if the $_POST variable is not empty.
note: NULL being a string saying NULL, not actually setting the variable to false or anything like that
-
*bookmarked*
-
your sql statement is incorrect also
use the backticks on the column names, not the values, place the values in single quotes instead
INSERT INTO `mytable` (`somecolumn`) VALUES ('somevalue')
-
<?php if(!$postcount) echo "welcome to the forum"; ?>
-
me for starters!
-
the uglies would hack the site
besides beauty is in the eye of the beholder
-
my latest idea was to, and its a silly one, make an alienbook. and only aliens are allowed to join. otherwise its the same as facebook.
its so stupid it might just work
-
yeah as over whelming as it was, im really looking forward to day 2!
-
I managed to land a job as a php developer last week, which i am really happy about.
had my first day today, and my brain feels like its going to explode. the company has 1 developer who is clearly a coding genius (as far as I can tell!) and when showing me how it all works, i got so swamped with code! its a full on cms which covers everything from simple page content to full ecommerce pages, the usual media stuff and much more.
I am not out of my depth, but definately out of my comfort zone! I think I can understand the code, but of course this system he has built up over a few years he has tried to explain to me in a few hours!!, I'm definately need to get my ass in gear!! haha. everything is so modular its amazing. I hope i can just pick it up quick enough that they see me as a good hire!
that said i loved ever minute of it, and just thought I'd share it all with you.
anyone else ever had a job like that? day one is just a big smack in the face!
-
yup, look how facebook destroyed myspace!
-
yeah i know, like i said its only for thumbnailing, but at the time it was enough for what i needed, i have outgorwn it since, but i make my own upload scripts since thats very easy. heres a snippet for you, I have pulled it from a class i wrote so will need a little bit of adjusting. it returns an array with 2 values, key 0 is either true or false and key 1 has a message:
<?php function handleUpload($fieldname) { $settings = systemcomponent::getSettings();//remove this as its irrelevant to you $upload = array(); if ((($_FILES["$fieldname"]["type"] == "image/gif") || ($_FILES["$fieldname"]["type"] == "image/jpeg") || ($_FILES["$fieldname"]["type"] == "image/pjpeg")) && ($_FILES["$fieldname"]["size"] < 200000) || ($_FILES["$fieldname"]["name"] == "")) //this bit restricts size and file type { if ($_FILES["$fieldname"]["error"] > 0 && $_FILES["$fieldname"]["error"] != 4) { $this->errors[] = "Image not saved in ImageControl->handleUpload(); || Return Code: " . $_FILES["$fieldname"]["error"] . "<br />"; //insert failed! Add error description to list of errors $upload[0] = 0; $upload[1] = "Image did not save"; return $upload; } else { $filename = str_replace("'","",$_FILES["$fieldname"]["name"]); // escape ' in file name! curse these people who not know how file naming should be done! lol if (file_exists($settings['imagedir'] . $_FILES["$fieldname"]["name"])) { $upload[0] = 0; if ($_FILES["$fieldname"]["name"] == "") { $upload[1] = "please select a file."; } else { $upload[1] = $_FILES["$fieldname"]["name"] . " already exists. "; } return $upload; } else { move_uploaded_file($_FILES["$fieldname"]["tmp_name"],$settings['imagedir'] . $filename);//change the $settings['imagedir'] to your upload directory $upload[0] = 1; $upload[1] = $filename; return $upload; } } } else { $upload[0] = 0; $upload[1] = "file type restricted or too large"; return $upload; } } ?>
-
it certainly isnt any harder!
-
heres another piccy, lol
-
i used this one in the past for thumbnailing, but have since decided its not got enough features, lol
ill make my own too one day.
[attachment deleted by admin]
-
id google it theres plenty of them out there
-
-
maybe this
i think that one returns everything about the field except its actual value, but i'm not sure
-
its mysql_fetch_row, but that only has numbers instead of column names: see here
-
i have had 2 people who are photographers, require a system that allows art gallerys to login who have exhibited the works of said photographer, when they make sales.
for instance a dude called cedric delsaux has made some amazing star wars images in a series called Dark Lens, but the prints are all limited. so he has exhibited them in paris, dubai, new york, but there is only say 10 copies of each print in 2 formats (sizes). so if paris sold 1, that gallery logs in and marks it as sold, add the details, then if new york sells one, it logs on and see that number 1 is sold and enters for number 2.
anyway i'm thinking of expanding it, improving it, making it a very professional setup but still undecided which way to go, which is either sold singularly to each photographer who wants it, or making it one big central site with all users join it and subscribe to it. (think of it having a social networking element to it)
here is a cedric image just cuz i love star wars
my most commmon point of failure is lack of marketing skills when it comes to dollar making ideas, i made a great site once called positivity pebbles, selling small polished stones, but due to bad SEO and frankly F.A. marketing i only sold about 10 stones in a year. plus its a huge market anyways, i just had a twist on my selling point. I need to re do it since i got 300 odd stones sat in a box doing nothing haha. but it was written in classic asp and i really cant be bothered right now.
-
welcome james james, is that is really your name. lol
I am pretty sure it will only work as long as any php code is in its php <?php ....?> brackets
but if someone calls up that file in the browser, they will see the php code, which wouldnt happen if the file was a .php in the first place
-
yeah i invented facebook.
nah sad to say i don't had plenty of ideas but not really put much effort into it, although i am thinking of making a niche system which i have done for a couple of clients in the past that doesnt seem to be 'out there' but its a long way off being a package to sell.
tend to suppliment my income with freelance sites.
-
its better to do it with them than without, cuz lets face it, you wouldnt have posted this thread if ya had
backticks for table names and column names, and single quotes for the data, then you won't fall over with column names that are reserved words
-
listen to the man above, lol. I was nearly there.
-
I think if you really want auto increment the only real other option is an invoice table on the db which will have the obvious Id column that auto increments, and perhaps a second column that is userid. that way you can when a new order is placed is create a row, and take the new ID and pass that as the orderid to the table you already have. it will mean a bit more coding but it should make it all much more manageable in the long run
1st day at the new job
in Miscellaneous
Posted
mine went