-
Posts
422 -
Joined
-
Last visited
-
Days Won
1
Everything posted by awjudd
-
That is a syntax error ... It should be: $connetion = mysql_connect($host,$username,$password) or die("connection could not be established"); Other than that we need more information about the error you are getting. @dougjohnson - you are missing a $ in front of password. ~juddster
-
You used the wrong quotes inside your query. It should be ' not ". ~juddster
-
You are missing an ending " after your $q line. As well as is $id numeric or a string? If it is a string, then you need it in quotes (''). Otherwise we need more information about the error. ~juddster
-
I agree entirely ~juddster
-
That is correct. You should be sending back the id and comparing against it. If the value isn't matching (and then adding the 'selected' attribute in) then that is where your problem may lie. ~juddster
-
Column 'credits' in field list is ambiguous Not according to the table definition you provided us. Please do not skip small details when providing us information because it just makes the responses you get back not as useful as they can be. SELECT t1.User, t1.credits, t2.links FROM table1 t1 JOIN table2 t2 ON t1.User = t2.user WHERE t1.credits > 0
-
If you look at it, after you select a value from the first drop down list and it auto posts back, the drop down list is back to 'Brand' which isn't correct. As I mentioned you need to change the condition where you are marking it as selected to be based on the ID rather than the name because that is the value being returned. Because of this, you are seeing the issue you mentioned. ~juddster
-
SELECT User, credits, links FROM table1 t1 JOIN table2 t2 ON t1.User = t2.user WHERE t1.credits > 0 ~juddster
-
This is now because you are CROSS JOINing the results from all of your tables. If you cross join against 3 tables each with 10 rows you are getting 1000 rows in your result set. So given each table is larger than 10 rows that is why it is taking forever to return. The LEFT JOINs all the way down except for against the KidsStudent table is the correct approach however, you just need to make sure your query is correct. ~juddster
-
On the separate pages you would grab where a specific news type is set. SELECT * FROM knews_local WHERE summary LIKE '%keyword%' UNION SELECT * FROM knews_mnews WHERE summary LIKE '%keyword%'
-
If you add the SUM that fenway suggested then it'll return one row again and work however it is not user specific. ~juddster
-
$Brand_N == $row["Brand_N"]? " selected" : "" That should be looking at the Brand_Id because that is the value that gets submitted. ~juddster
-
Please expand ... ~juddster
-
$sql = "SELECT * FROM products WHERE Brand_id = $Brand_id "; That $Brand_id should be $Brand_N. ~juddster
-
Post updated code? ~juddster
-
Huh?
-
<select name="brand" onChange="autoSubmit();"> Please Note: lowercase "brand" as in the name attribute of the select box. ~juddster
-
add print_r ( $_POST ); to your code and you can see everything being posted. Edit: I said $_POST [ 'brand' ] not $_POST [ 'Brand' ] ... please note ... the array is case sensitive. ~juddster
-
$_POST [ 'Brand_N' ] should be referenced as $_POST [ 'brand' ] since that is the name of the drop down list being submitted. ~juddster
-
In your previous code you had: <select name="brand" onChange="autoSubmit();"> PHP uses this name when posted in the $_POST array. Because of that, you should be looking for $_POST['brand'] instead of $_POST['Brand_N']. ~juddster
-
Now you aren't setting the variables. All you needed to change in your last post was the posted value you were looking for (i.e. 'Brand_N' to 'brand'). To get that value. ~juddster
-
Your select for brand's name is 'brand' not 'Brand_N', so the value will never be viewed as posted. ~juddster
-
Your query is wrong ... using ' instead of `. $db="SELECT * FROM `$tble` WHERE `b1#` = '{$b1_num}' AND`c1#` = '{$c1_num}'" ; $db="SELECT * FROM `$tble` WHERE `a1#` = '{$a1_num}' AND `b1#` = '{$b1_num}' AND `c1#` = '{$c1_num}'" ; ~juddster
-
It is a data type: http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html ~juddster
-
By using any of php's built in directory functions? i.e. scandir ~juddster