Results 1 to 9 of 9
-
16th Apr 2012, 07:04 AM #1OPMember
mysql syntax error
there's a syntax error in this mysql statement.. please help.. thanks a ton..
$fetch_users_data = mysql_fetch_object(mysql_query("SELECT * FROM 'members' WHERE username=".$_SESSION['username'].""));
---------- Post added 16th Apr 2012 at 07:04 AM ---------- Previous post was 15th Apr 2012 at 11:38 AM ----------
bumpgamma Reviewed by gamma on . mysql syntax error there's a syntax error in this mysql statement.. please help.. thanks a ton.. $fetch_users_data = mysql_fetch_object(mysql_query("SELECT * FROM 'members' WHERE username=".$_SESSION."")); ---------- Post added 16th Apr 2012 at 07:04 AM ---------- Previous post was 15th Apr 2012 at 11:38 AM ---------- bump Rating: 5
-
17th Apr 2012, 12:44 PM #2OPMember
please help me I keep getting this error: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/linksnap/public_html/includes.php
-
17th Apr 2012, 01:12 PM #3Member
Instead of 1 big line, try to split it up, so you can identify the error better.
PHP Code:$username = $_SESSION['username'];
$mysqlquery = mysql_query("SELECT * FROM members WHERE username='$username'");
$fetch_users_data = mysql_fetch_object($mysqlquery);
-
17th Apr 2012, 06:46 PM #4OPMember
-
17th Apr 2012, 06:53 PM #5MemberWebsite's:
LulzCovers.com LulzTroll.comtry this
PHP Code:$username = $_SESSION['username'];
echo $username;
$mysqlquery = mysql_query("SELECT * FROM members WHERE username='" . $username ."'");
$fetch_users_data = mysql_fetch_object($mysqlquery);
Contact me for Traffic, SEO, WCDDL, Wordpress, IPB related Services or queries.
Template Designing, PSD to HTML, Wordpress
-
17th Apr 2012, 07:00 PM #6MemberWebsite's:
wscripts.net damnlolscript.com lulzjet.comtry this:
Code:$username = $_SESSION['username']; $sql = mysql_query("SELECT * FROM members WHERE username='" . $username ."'") or die(mysql_error()); $fetch_users_data = mysql_fetch_object($mysqlquery);
-
17th Apr 2012, 07:32 PM #7OPMember
-
17th Apr 2012, 08:38 PM #8Member
No, i think the error is because the username is empty, try
PHP Code:$username = $_SESSION['username'];
$mysqlquery = mysql_query("SELECT * FROM members WHERE username='" . $username ."'");
if ($mysqlquery)
$fetch_users_data = mysql_fetch_object($mysqlquery);
else
die("username=" . $username . " mysql error=" . mysql_error());
-
18th Apr 2012, 04:11 AM #9
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Syntax Error
By Qoo in forum WordpressReplies: 0Last Post: 7th Jun 2012, 02:23 PM -
Database error-mysql error
By saini in forum vBulletinReplies: 8Last Post: 8th Nov 2011, 06:54 AM -
MYSQL Error while Import via MYSQL Dumper (Error
By desibreaker in forum Server ManagementReplies: 10Last Post: 5th Aug 2011, 07:26 PM -
MySQL Error!
By jackiebi in forum Technical Help Desk SupportReplies: 0Last Post: 22nd Jul 2011, 06:18 AM -
Syntax Error
By Ryan in forum phpBBReplies: 3Last Post: 12th Feb 2009, 10:24 PM
themaPoster - post to forums and...
Version 5.22 released. Open older version (or...