Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
I think you mean to say are case sensitive.
-
As was said before, you're not defining $option_name or $option_price. You're doing those statements backwards, you're saying that the first key in $option_part should be set to the value within $option_name. $option_name does not exist. Switch it around.
-
You're not doing anything else before that?
-
on your page do a print_r($_POST);
-
Getting data based on a dynamic dropdown list
Jessica replied to greensteam's topic in PHP Coding Help
If you want to PM it to me I'd be happy to look and try to debug, or you can install a javascript debugger which is what I would try, but I'm happy to help. -
That's what I get for skimming. Plus the method was on the next line. thanks for correcting this.
-
your form action is not set to post, it is set to URL which I have never even seen, pretty sure that's not valid. post and get are valid. (get is the ones in the url, post are hidden).
-
Loop through Three Variables but Make them Always = 1
Jessica replied to unemployment's topic in PHP Coding Help
Instead of $var_x, you need another array like $vars[] and loop through THAT, possibly set by an argument in your function call. -
You need single quotes around a string. I assume $Account = 'Techker'. It thinks you're looking for a column since it's not within quotes.
-
No, HTML cannot do that. You could use PHP and regular expressions to check if it's an email, then return an error. Considering users can easily turn off JS, this is practically required.
-
I would suggest googling "data normalizing". the way you are storing your data is not a great idea, regardless of your reasoning for it.
-
Getting data based on a dynamic dropdown list
Jessica replied to greensteam's topic in PHP Coding Help
Is this a public site? If you can post a link, sometimes it's a lot easier to debug javascript when you can see it happening. And use firebug. If it's possible, please post a link as well. -
Did Muddy_Funster's code work? It seems fairly simple but you did not respond as to whether or not that did the trick?
-
1. You never close your function call 2. You would define $max_results=1, then send $max_results as the argument. Right now you're either causing a fatal error or sending the success/fail of setting $max_results=1 (which would succeed). I can't remember which would happen.
-
CAPTCHA....Ya killin' me smalls!
Jessica replied to austinlikesdubstep's topic in PHPFreaks.com Website Feedback
I believe CSS is plural. Sheets. I'd love to see some of these, I don't remember ever having to do that but it was what, 6 years ago? -
Javascript. Are you asking how to use AJAX? since you're using jQuery you should be able to look up their documentation on their AJAX functionality and use that. I skimmed your full code but don't see anywhere you attempt to use jQuery's AJAX stuff.
-
Actually I'm sorry, I see you did put the hidden input, but it looks like IT has no value. When you select your $row, can you print_r() it, so we can see what is in $row when it is first created?
-
No, that line will take the value FROM the posted data. Data will only be posted if it is inside the HTML form element, and has a form element with a name. So $item_id= $_POST['item_id']; will get you the value that was entered within the form in an input with the name "item_id". It can be a hidden input.
-
Loop through Three Variables but Make them Always = 1
Jessica replied to unemployment's topic in PHP Coding Help
Well you take what I wrote and adapt it, I wasn't trying to actually write the whole thing for you, you won't learn that way. PS: it wasn't a function, but you could easily make it a function. That is what you'll need to do based on your post -
Okay, so do you know what the $_POST array is? Do you have knowledge of HTML? I assume you got this code from a tutorial?
-
So you can tell that one of your variables has no value at the time you try to run that query. Looks like your form is not posting the item_id. Try adding print_r($_POST); before you set those variables from the form. But it is obvious from your form html that you never send that value.
-
Loop through Three Variables but Make them Always = 1
Jessica replied to unemployment's topic in PHP Coding Help
You lost me. -
You have several queries, do you know which one is throwing this error? It looks like the first one you've posted. Based on the error, I'd say one of your variables is empty. When you throw the error, (the or die(mysql_error()); party), add in the query string to your die. or die(mysql_error().': '.$query); Other problems: This line: $query.= "UPDATE links SET item_id = '$item_id', category_id = '$category_id',"; Will not only never run because you redirect afterwards, that query cannot be appended to any other one, and you end it with a comma which should also produce an error. you also need to sanitize user input, and you don't need to put parentheses around your strings.
-
You never run the query, and you never closed your string when creating it. Are you familiar with PHP at all, that is what language you are going to use to run the SQL query.
-
Loop through Three Variables but Make them Always = 1
Jessica replied to unemployment's topic in PHP Coding Help
That's a LOT of combinations. I think you'd need a recursive function maybe? *thinking*. The maximum count is going to be 100, and the min is 1. so... $combos = array(); for($num=1; $num<=100; $num++){ $combo = array(); for($values=1; $values<=$num; $values++){ $combo[] = 0.01; } $combo[] = 1-($num*0.01); $combos[] = $combo; } Would get you all of the combos with only values of 0.01 and the other max value. Not sure where to go from there, math is hard.