-
Posts
3,372 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Muddy_Funster
-
mysql_fetch_array() expects parameter 1 to be resource error =P
Muddy_Funster replied to imod3rn's topic in PHP Coding Help
AFTER you have changed you're code to reflect what Ken posted take note of the ...or die ("Problem with the query: $q<br>" . mysql_error()); This should be used during development to handle any errors your queries generate. Also, you shouldn't use double quotes to wrap string values in SQL, always use single ones. Now you can put the spaces in after the comma's and the = and as long as your field names and table name are accurate you should be good to go. If not you should at least get a much more practical error message. -
AOL is a poain for a lot of things - although I was just reffering to the need to be carefull about the way restrictions are placed, if a user is bound to an IP at signup, and that information stored and recalled for validation at login, then there will likely be problems.
-
need help starting a db for and election page
Muddy_Funster replied to ROCKINDANO's topic in MySQL Help
Yeah, miko is right. I thought that you had the need to store seven lines for each locations address. And by all means reduce the length of the fields, I just made that long to play it safe as I don't know (obviously) what lenth of information you will need to store for each line nad addresses have the potential to be quite long at times (thinking Welsh place names are a good example). As I said, this was just an at a glance recomendation, I assume that if you are in the position to be "picking up projects" then you have a good working knowledge of what you are using. -
Hey Keith, many thanks for taking a look. I'll give it a try when I'm back in the office tomorrow. But there are over 9400 rows in tbl_dialog ( I did a SELECT COUNT(*) from the table when I got the random 4700 results per sheet returning as I instantly thought that it was looping the select from that table for every sheet ID) although I had thought that linking the JOIN on the sheetID field within the case would have been enough. I did try a LEFT JOIN at one point, but it only returned the sheets that had comments on them, although I can't remember if I tried it in conjunction with the CASE or not.
-
need help starting a db for and election page
Muddy_Funster replied to ROCKINDANO's topic in MySQL Help
If you are going to have 7 lines of address then sure make 7 address fields. -
I would never think about storing a password value in plain text (not in the code, and certainly not on an EU's computer). Look into encypting and the use of SALT for password info.
-
need help starting a db for and election page
Muddy_Funster replied to ROCKINDANO's topic in MySQL Help
At first glance I would go with tbl_runners runner_id -- TINYINT(2), AUTO_INC, PK first_name -- VARCHAR (50) last_name -- VARCHAR (50) tbl_location location_id -- TINYINT(2), AUTO_INC, PK name -- VARCHAR (255) address1 -- VARCHAR (120) address2 -- VARCHAR (120) address3 -- VARCHAR (120) postcode -- VARCHAR (9) tbl_votes vote_id -- INT(20), AUTO_INC, PK location_id -- TINYINT(2), FK runner_id -- TINYINT(2), FK votes -- INT (255) where PK is Primary Key and FK is Foreign Key -
why echo is not echoin d entire field in database
Muddy_Funster replied to madhmad's topic in PHP Coding Help
I don't think that varchar fields over (255) are fully supported. if you want your field to be 300 characters long then change the field type to TEXT (300) and see how you get on. -
why echo is not echoin d entire field in database
Muddy_Funster replied to madhmad's topic in PHP Coding Help
could you post thorough information regarding your table structure please? -
can you give an example dataset that comes from runnning your query $sql1 = "SELECT buss_name, buss_desc, buss_video, buss_link, city, zipcode, country, address, tag FROM wp_business WHERE (lat BETWEEN ($lat - $lat_range) AND ($lat + $lat_range)) AND (lon BETWEEN ($lon - $lon_range) AND ($lon + $lon_range)) AND Comp_name ='".$_GET['category']."' order by lat,lon desc LIMIT 7 "; also, if you run it 5 times, is it the same result every time or different?
-
haha I find golf even more frustrating . fact is you are using neither of the two files you listed. the only file you will be using is php.ini if you don't have a fille called that, either in your %windir% or in the php core folder, then you will need to rename one of the two files that listed to be php.ini - I would suggest the development one, as that will have the error reporting turned on. Look up the guides here at freaks and go through the guide for installing a WAMP server for your php version to double check that all the other settings are as they should be.
-
without going into the lack of wizdom in storing randomised numbers in this scenario, you will need to start the page (as is the verry fist line) with <?php session_start(); ?> .
-
no worries
-
echo out the value of $_SESSION['id'] and make sure it is what it should be. Also, make sure that every page sarts with the following lines of code at the very start <?php SESSION_START();
-
Yes, you need the quotes around the SESSION[] elements. You should also only use single quotes around sql strings. your query should look like: $sql= "INSERT INTO member ( username, email ) VALUES ( '".$_SESSION['nm_username']."', '".$_SESSION['nm_email']."' )"; using . to concatenate the string values with the variable contents.
-
you will either need to use session variables to transfer variable values between pages or use the URL of the form action to pass it over to the next page and use $_GET on the target page to pull it into the page content there.
-
You should probably have a look at this: http://www.w3schools.com/xml/xml_encoding.asp for more info and options.
-
what encoding are you setting in the header of the XML file?
-
$query = "Select name from my_table where dob = '$birthday'"; should do it, dates need to be wraped in single quotes within the sql.
-
instead of $query= "SELECT MAX(inv_num) AS max_inv_num FROM orders" you could use $query= "SELECT inv_num AS max_inv_num FROM orders ORDER BY inv_num DESC LIMIT 1" And please use code/php tags for posting up any code
-
What do you mean "identical"? did you make it an AUTO_INC field? cause that won't work. change your code to this: //insert information $id = $_SESSION['id']; $sql = mysql_query("INSERT INTO messages(message, userid)values('$msg', $id)") or die ('ERROR! During Insert :<br> '.mysql_error()); $result = mysql_query("SELECT msg_id, message FROM messages order by msg_id desc")or die ('ERROR! During Read :<br> '.mysql_error()); WHILE ($row = mysql_fetch_assoc($result)) { $id = $row["msg_id"]; $msg = $row["message"]; } }
-
No, you should have had a long set of tables giving all the settings that are stored in PHP.ini Either php is not enabled on the server that you are using for this project, or (mainly with IIS and fast cgi) the directory that you using is not set to allow scripting and execution.
-
what did the print_r give out? as I said, i'm not the best with arrays, but I think by leaving out the quotes you are defining a constant rather than a variable (not an integer rather than a string) but I'm probably wrong :/.
-
Could you to a print_r on $userfail, also, I think you missed the single quotes from userid here : $userfail[$row[userid]]=$getuser; I'm not the best with arrays, so I'm not sure how much I can help.
-
ok, do the tables refference each other at all? and what field types are they all?