/    Sign up×
Community /Pin to ProfileBookmark

MySQL Error, Convert SQL -> MySQL

I usually write stuff in sequel, can someone help me convert this, i’m having problems.

[code=php]
$look_up_user_info = mysql_query(“SELECT * FROM `user_system` WHERE `Email_Address` = ‘$email_address’ AND `List_Code` = ‘$free_gift'”, $dbconn);
while($view_column = mysql_fetch_array($look_up_user_info)) {
$lui_first_name = trim(”.$view_column[‘First_Name’].”);
$lui_last_name = trim(”.$view_column[‘Last_Name’].”);
$lui_customer_id = trim(”.$view_column[‘Customer_Ref_ID’].”);
}

if(mysql_fetch_row($look_up_user_info))
{
$result = mysql_do($dbconn, $look_up_user_info);
mysql_do($dbconn, $look_up_user_info);

echo “good”;
}
else
{
echo “bad”;
}
[/code]

I just want a yes or no if query finds the record that is searched for, if not, display bad.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@ShrineDesignsMar 30.2005 — there is not function mysql_do(), i think you may have mistaken MySQL for ODBC or mSQL

http://www.php.net/manual/en/ref.mysql.php
Copy linkTweet thisAlerts:
@NogDogMar 30.2005 — [code=php]
if(mysql_num_rows( $look_up_user_info) > 0)
{
# good
}
else
{
# bad
}
[/code]
×

Success!

Help @d_brandusa spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...