Search found 12 matches

by techm3
Fri Jun 29, 2012 4:23 pm
Forum: PHP
Topic: Combobox, PHP and MySQL
Replies: 6
Views: 4001

Re: Combobox, PHP and MySQL

No, it doesn't. Everything looks like it supposed to be.
by techm3
Fri Jun 29, 2012 3:42 am
Forum: PHP
Topic: Combobox, PHP and MySQL
Replies: 6
Views: 4001

Re: Combobox, PHP and MySQL

Here's the page code. <?php include('../example/other.php'); $users_info = fetch_users_info($_SESSION['username']); if(!isset($_SESSION['username'])){ header('Location: http://example.com'); die(); } $errors = array(); if(isset($_REQUEST['mode']) && $_REQUEST['mode'] == "send"){ if...
by techm3
Thu Jun 28, 2012 4:28 am
Forum: PHP
Topic: Combobox, PHP and MySQL
Replies: 6
Views: 4001

Combobox, PHP and MySQL

Hi there, I'm populating a combobox with values stored in a database. When I try to submit the form again the combobox gets no value at all. <?php $errors = array(); if(isset($_REQUEST['mode']) && $_REQUEST['mode'] == "send"){ if (empty($_POST['touser'])) $errors[] = "Seleccio...
by techm3
Tue Jan 24, 2012 1:02 am
Forum: PHP
Topic: Wrong Code?
Replies: 7
Views: 1679

Re: Wrong Code?

So, I did what you said and I still get no error. But I noticed that when I write something on the fields called 'of' (Second Query) it does work and create the row on the database. If not, it won't create it. This creates a doubt on me. Isn't PHP supposed to create the row with the values that are ...
by techm3
Mon Jan 23, 2012 1:36 am
Forum: PHP
Topic: Wrong Code?
Replies: 7
Views: 1679

Re: Wrong Code?

Ok. Here is the complete code. Hope you can help me. :) <?php include('init.inc.php'); $b_name = mysql_real_escape_string(htmlentities($_POST['b_name'])); $b_phone_number = mysql_real_escape_string(htmlentities($_POST['b_phone_number'])); $b_address = mysql_real_escape_string(htmlentities($_POST['b_...
by techm3
Sat Jan 21, 2012 2:05 pm
Forum: PHP
Topic: Wrong Code?
Replies: 7
Views: 1679

Re: Wrong Code?

I cover every column name with ` but it doesn't work. And by using
echo mysql_error();
I get no error :?
by techm3
Mon Jan 16, 2012 6:52 pm
Forum: PHP
Topic: Wrong Code?
Replies: 7
Views: 1679

Wrong Code?

I'm using this code in the same page. The last query works. Does anyone sees something wrong in the code? The table name and the fields are ok. $b_name = mysql_real_escape_string(htmlentities($_POST['b_name'])); // Updates Offers $of1 = mysql_real_escape_string(htmlentities($_POST['of1'])); $of2 = m...
by techm3
Wed Jan 04, 2012 7:52 am
Forum: PHP
Topic: Can't connect to local MySQL server through socket
Replies: 1
Views: 9825

Re: Can't connect to local MySQL server through socket

Sorry! It was a Typo.

It's working.
by techm3
Wed Jan 04, 2012 5:47 am
Forum: PHP
Topic: Can't connect to local MySQL server through socket
Replies: 1
Views: 9825

Can't connect to local MySQL server through socket

Here I'm again. I'm using this code (From line 142 - 196): function fetch_business_info($name){ $sql = "SELECT `b_name`, `b_address`, `b_city`, `b_country`, `b_category`, `b_email`, `b_website` FROM `business_information` WHERE `b_name` = '{$name}'"; $result = mysql_query($sql); return mys...
by techm3
Thu Dec 29, 2011 4:44 pm
Forum: PHP
Topic: mysql_fetch_assoc(): supplied argument is not a valid MySQL
Replies: 5
Views: 1128

Re: mysql_fetch_assoc(): supplied argument is not a valid My

Thanks for all your replies.

@EcazS '{$name}' solve it :D
Thank You!
by techm3
Thu Dec 29, 2011 1:03 pm
Forum: PHP
Topic: mysql_fetch_assoc(): supplied argument is not a valid MySQL
Replies: 5
Views: 1128

Re: mysql_fetch_assoc(): supplied argument is not a valid My

I tried using the following code: <?php //fetches profile information for the given user function fetch_user_info($cname){ $sql = "SELECT `cname`, `address`, `tel`, `email`, `wsite` FROM `cInfo` WHERE `cname` = {$cname}"; $result = mysql_query($sql); return mysql_fetch_assoc($result); } ?>...
by techm3
Wed Dec 28, 2011 3:37 pm
Forum: PHP
Topic: mysql_fetch_assoc(): supplied argument is not a valid MySQL
Replies: 5
Views: 1128

mysql_fetch_assoc(): supplied argument is not a valid MySQL

Hi there, Im using this code: <?php function fetch_user_info($name){ $sql = "SELECT 'bname' AS 'name', 'email' AS 'email', 'website' AS 'website', FROM 'cInfo' WHERE 'name' = {$name}"; $result = mysql_query($sql); return mysql_fetch_assoc($result); } ?> but I'm getting "Warning: mysql...