Mahngiel
-
Posts
1,068 -
Joined
-
Last visited
Posts posted by Mahngiel
-
-
I played with some conditional joins last night, and after a couple hours came up with the code below.
What's going on is I have several api resources that a row may belong to, and a supplemental api_id that relates to it. Based on the value of the api_resource, I am joining the appropriate table. Being new using conditionals in MySQL, I would like to know if there is a better way to accomplish this.
SELECT t.id, t.name, CASE t.api_resource WHEN "x" THEN x.title WHEN "y" THEN y.title END as title, CASE t.api_resource WHEN "x" THEN x.genre WHEN "y" THEN y.genre END as genre FROM `files` t LEFT JOIN `file_x` x ON (t.api_resource = "x" AND t.api_id = x.id) LEFT JOIN `file_y` y ON (t.api_resource = "y" AND t.api_id = y.id) WHERE t.api_id != 0 ORDER BY t.date DESC
The resulting object:
Object ( [id] => 1 [name] => Some name [title] => Title of api item [genre] => Genre of api item )
Thanks.
-
both ff 14 and 15 look like this in my windows 7
-
whatchu talkin' bout, willis?
-
if(!$ses_user && !$ses_pass){ echo "You need to be logged in to view this page."; }
(i hope you're encrypting your sessions.)
an
echo
alone is not suffice for a security measure at all. You could use adie()
or aheader()
to a bolo page instead. -
The max weigth determination is likely an Occupational and Safety Health Association (OSHA) regulation because UPS is a one-man gig and having to lift greater than 150 pounds isn't a great idea. I see nothing about limitations on the 70 lb packages
-
probably a path problem. open up the Source and try to follow the link to your CSS. if a) there is no link, you now it's not included. if b) the link 404's you know it's a path issue.
Tip: link your CSS from the http path and not relative path. Your last post said you were using codeigniter, so go example.com/application/views/style.css
-
Changing the error deliminators does not mean you do not have to tell CI where to output the errors at. You still need to include this bit of code:
if(validation_errors()): echo validation_errors(); endif;
-
It makes more sense if you were working with a longer path.
yes, but / is root is root is root. it doesn't matter if you're 15 levels deep, / is le whole enchilada!
I add to the current theme, I once truncated the user table from the live environment. :o
-
i think scootstah meant pwd... but yea, a good ol' . would suffice there haha. hard to learn if you never make mistakes!
-
Well there must be a reason why it was Godaddy instead of HostGator and other hosting companies.
Do you actually read things before you post?
-
It was not meant to offend you, simply to show the OP that it's harder than that because the structure of _FILES changes when you upload multiple files.
@Ignace
No offense taken. You were correct in pointing out my post was half-assed
@ Spertuit
Dude, listen, if you're going to apply the same exact steps to more than one object, you should really think about loops. ignace showed you how the
foreach()
looks, and i suggest u give it a whack. -
Barand, give up man. You cannot help those who do not wish to be helped.
-
Or this, can someone lead me in the right direction for the code I should be using?
The code you should be using is code that satisfies your requirements.
add a checklogin code to a registration page ...
someone can add details into a database...
checks if they are looged in.
Based on your code examples, I suppose you mean a login form and you seem to have general idea. Do you have any specific problems?
BTW, I added some content to my signature.
-
Im not sure what the full checklogin function is.
I'm sorry, but why the hell not? Why would you run code you don't know what it is?
-
i'll make sure to eat my wheaties tomorrow, thank you for correcting me.
-
you could remove the window from the DOM (js) or you could redirect to a new page (php or js).
-
where's the
checkLogin()
function? do you need to include/require it? -
I think you'd be pleasantly surprised by the information provided if you var_dump 'd
$_FILES
.You'll want to rename your multipart input fields to an array:
<input name='files[1]' ... 'files[2]'
Then you can
foreach( $_FILES['files'] as $upload )
Then, it won't matter if you have one or fifty file slots.
-
reset your web server
-
/me <3 SimCity!
I've played the series for many, many years. There are a plethora of Sim* games that they put out which weren't worth a damn, IMO, but SimCity has always been enjoyable for me. I'd def grab a copy.
-
Confusion can be resolved through education and trials. Your problem cannot be resolved without details.
-
does this thing break when there is no associated data?
-
The username & password I entered were valid because I copied and pasted them from the database.
if you can copy/paste user credentials from the database, you need to start over and read about hashing.
-
it doesn't work because = is for assigning, while == and === are for comparison
finding out what z-index are used
in Other
Posted
You can take a look at Firebug extensions or if you're using a modern browser, the 'Inspect Element / Web Page' from the right-click context menu:
http://prntscr.com/fnvrz