jbegreen Posted June 6, 2013 Share Posted June 6, 2013 Hi Guys Can anyone help me with this <?php require_once('Connections/w2w.php'); ?> <? $username_entry = 'jack'; $query = mysql_query ("SELECT * FROM ofnissenisub321 WHERE username = $username_entry "); $rows = mysql_fetch_array($query); $username = $rows['username']; $password = $rows['password']; $business_name = $rows['business_name']; $address1 = $rows['address1']; $address2 = $rows['address2']; $address3 = $rows['address3']; $postcode = $rows['postcode']; $email = $rows['email']; $website = $rows['website']; $facebook = $rows['facebook']; $twitter = $rows['twitter']; $linkedin = $rows['linkedin']; $openfrom1 = $rows['openfrom1']; $openfrom2 = $rows['openfrom2']; $openfrom3 = $rows['openfrom3']; $openfrom4 = $rows['openfrom4']; $openfrom5 = $rows['openfrom5']; $openfrom6 = $rows['openfrom6']; $openfrom7 = $rows['openfrom7']; $opento1 = $rows['opento1']; $opento2 = $rows['opento2']; $opento3 = $rows['opento3']; $opento4 = $rows['opento4']; $opento5 = $rows['opento5']; $opento6 = $rows['opento6']; $opento7 = $rows['opento7']; $business_type = $rows['business_type']; $business_description = $rows['business_description']; $managers_message = $rows['managers_message']; $image1 = $rows['image1']; $image2 = $rows['image2']; $image3 = $rows['image3']; $image4 = $rows['image4']; $image5 = $rows['image5']; echo "$password"; ?> I get the following error Warning mysql_fetch_array is not a valid SQL result resource at........ Why is this happening?? Hope somebody can help Thanks Quote Link to comment https://forums.phpfreaks.com/topic/278837-drawin-selection-from-db/ Share on other sites More sharing options...
trq Posted June 6, 2013 Share Posted June 6, 2013 Why is this happening?? Because your query is failing and you have zero error checking. Why is your query failing? Probably because strings need to be surrounded by quotes in SQL. Quote Link to comment https://forums.phpfreaks.com/topic/278837-drawin-selection-from-db/#findComment-1434386 Share on other sites More sharing options...
jbegreen Posted June 6, 2013 Author Share Posted June 6, 2013 Can you explain please. $query = mysql_query ("SELECT * FROM ofnissenisub321 WHERE username = $username_entry "); while($rows = mysql_fetch_array("$query")); Newbie Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/278837-drawin-selection-from-db/#findComment-1434392 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.