Minklet Posted August 5, 2010 Share Posted August 5, 2010 I'm trying to populate a profile page with information from the database. Really bizarrely, every $row variable that isn't null returns as 'website', which is the database username. I have absolutely no idea why this is. It might be worth noting I have just changed hosts...the only thing I can think might make a difference. Any help would be great, thankyou query = "SELECT * FROM member WHERE username='$member'"; $result = mysqli_query ($dbc, $query) or trigger_error ("query: $query\n<br />MySQL Error: " . mysqli_error($dbc)); if ($result) { while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { $member_id = $row['member_id']; $username = $row['username_id']; $photo = $row['photo']; $about = $row['about']; $slink = $row['soundcloud_link']; $mlink = $row['mixcloud_link']; $flink = $row['facebook_link']; $dlink = $row['divshare_link']; $mylink = $row['myspace_link']; $plink = $row['postbocks_links']; $website = $row['personal_website']; $type = $row['member_type']; $status = $row['status']; } } } Quote Link to comment https://forums.phpfreaks.com/topic/209908-really-odd-mysqli_fetch_array-behaviour/ Share on other sites More sharing options...
Minklet Posted August 5, 2010 Author Share Posted August 5, 2010 Can you not edit a post on this forum? Noticed I missed $ off $query in my post. It is present in the actual script. I have echo'd the query and the result is fine when put directly into sql Quote Link to comment https://forums.phpfreaks.com/topic/209908-really-odd-mysqli_fetch_array-behaviour/#findComment-1095637 Share on other sites More sharing options...
fenway Posted August 5, 2010 Share Posted August 5, 2010 If you have a php problem, try a php solution -- dump $row. Quote Link to comment https://forums.phpfreaks.com/topic/209908-really-odd-mysqli_fetch_array-behaviour/#findComment-1095655 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.