Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
What you need is urlencode(). echo urlencode("3278 Blue Jay dr, scottsdale AZ 44559");
-
It's the same thing as doing: $mess = $mess . ":".$splitu[$i].":"; A better example is with an arithmetic example: $a = 2; $b = 4; $a += $b; This is the same as $a = $a + $b;
-
You're not creating the array correctly. $Array = Array("0000", "0010", "9000"); Before you were just giving it 1 element [0] => '"0000", "0010", "9000"'
-
[SOLVED] Problems executing queries / returns blank page
Maq replied to mrbuzz's topic in PHP Coding Help
Can you post the code for the entire page that shows a blank page? -
You're not concatenating each letter with the surrounding ':' character. You're always overwriting the last $mess with the new split element. Change this line to: (notice the . ) $mess .= ":".$splitu[$i].":";
-
[SOLVED] Problems executing queries / returns blank page
Maq replied to mrbuzz's topic in PHP Coding Help
Without examining your code I can tell you the most of the time a blank page usually refers to a fatal syntactical error that's being suppressed. After your first opening <?php tag add these lines: ini_set ("display_errors", "1"); error_reporting(E_ALL); -
Check out this sticky: http://www.phpfreaks.com/forums/index.php/topic,54859.0.html
-
Check out this thread: http://www.phpfreaks.com/forums/index.php/topic,247209.0.html
-
1) Your query may be failing, change this line: [code] $result = mysql_query($qry) or die(mysql_error()); 2) This IF is failing. if(mysql_num_rows($result) == 1) { [/code]
-
I see, I'm assuming you are talking about suggesting this to him the other night. His query in his original post did not have a JOIN but he did match against common fields so there are no duplicates. Which can have the same effect. In any event, glad it's working.
-
Hmm that's weird it's working because your options don't have any values... Well, if it works it work Please mark as [sOLVED].
-
I believe I mentioned this in one of my previous posts but, the problem that's occurring is due to the extra comma after the #22. You have to change your logic a bit. $i=0; //ADDED $query = "SELECT * FROM supplements WHERE supp_id IN ("; foreach ($_SESSION['cart'] as $key => $value) { $query .= ($i==0) ? $key : ','.$key; //CHANGED $i++; //ADDED }
-
Also, when you invoke stripslashes() on a variable it doesn't change the variable unless you re-assign it. It will display the $landline with stripslashes but it doesn't actually change the value.
-
YW I assume this solves your problem? Please mark [sOLVED], thanks!
-
You can actually change your code in the CSS for a specific browser(s) by using browser conditionals. i.e. A full list of this can be found here: CSS - Conditionals
-
You have to select your DB before you perform your query. You also should check your $con before you select your DB. Change these lines so they're in this order: $con = mysql_connect($dbhost, $dbuser, $dbpass); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db($dbname, $con); $members = mysql_query("SELECT * FROM accounts");
-
Your first page should look like: (I assume this is already in a form) for($i=0; $i echo ""; $result_emp = mysql_query("SELECT * FROM emp_details"); while($row = mysql_fetch_assoc($result_emp)) { echo "".$row['emp_f_name']." ".$row['emp_l_name'].""; } echo ""; } ?> Second page, try this: foreach ($_POST['emp_id'] as $value) { echo "Value: $value \n"; }
-
Change this line to: die('Could not connect: ' . mysql_error());
-
[quote author=PFMaBiSmAd link=topic=87000.msg1156505#msg1156505 date=1239334891] He's just posting non-relevant crap to get a link to his site on this forum. I already reported the post. [/quote] Yes, he most definitely is. Only has 2 posts but they both reference his/the site... Good luck with your advertising technique!
-
[quote]A) The thread was probably solved three years ago,[/quote] Hahaha, didn't even see the date... I always click on "Show unread posts since last visit.", and respond. jfnavat, it's all your fault!!! j/k How did you find this thread anyway?
-
True, but that forum is in spanish...
-
If your ultimate goal is to see if the number is in the array you can just use in_array(). Not really sure what that means... You can get the first and second digit of $var by doing: $var = "98"; echo "First Digit: " . $var[0]; echo " Second Digit: " . $var[1]; ?> Hope this helps.
-
Are you declaring $emp_id_array as an array? Forget about the code I suggested before and try replacing this block with this: $emp_id_array = array(); for ($i=0; $i{ $emp_id_array = addslashes($_POST['emp_id'][$i]); } foreach ($emp_id_array as $value) { echo "Value: $value \n"; }
-
It's hard to tell without knowing the design of how your forums are setup, but I believe this clause: AND p.parentid='0' would only grab posts from the "main board". You may want to change it to something similar to: AND p.parentid IN(0, 1, 2 ,3) Again, I would need to know your table structure and how you differentiate the "main board" from children. Hope this helps.
-
That will also put a comma in front of the first extracted record. You might want something like: $title .= (!isset($title)) ? $row['title'] : ", ".$row['title']; But if the way you have works, it works...