Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-01-2012, 03:37 PM   PM User | #1
urhelper
New to the CF scene

 
Join Date: Oct 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
urhelper is an unknown quantity at this point
DataLife engine need simple help

Hi!
I am running Datalife engine script , i want to create a new tab for showing money from database for users near logout button,
i write php code for this in engine/modules/newfile-created-byme.php
PHP Code:
<?php
define 
'DATALIFEENGINE'true );
include(
"/engine/modules/sitelogin.php");
$sqlz "SELECT * FROM dle_users WHERE user_id=='$member_id[user_id]'";
$resultz mysql_query($sqlz);
$row mysql_fetch_array($resultz);
?>
<html>
<li><a href="../wall/cashout.php" title="Account Balance"><span>Rs <? echo $row["money"]; ?> </span></a></li>
</html>

i got error undefines variable row in html code

I want to know that how can i track user name or id of login user to put in "WHERE user_id="
and than how place in login.tpl file
i am testing script here http://xfanbux.freehosting.com/3/ for gemini template
thanks
bye the way i want to give money to users by adding news (pay per post) is there any easy method to do this or any other script for same
thanks again

Last edited by Inigoesdr; 10-01-2012 at 04:02 PM..
urhelper is offline   Reply With Quote
Old 10-01-2012, 03:43 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,649
Thanks: 4
Thanked 2,450 Times in 2,419 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
SQL doesn't use == for comparison as you have here: user_id==. It uses single =, so that would be user_id = '{$member_id['user_id']}' assuming that $member_id is declared by that include (which means it should be a require[_once] call instead).
The error you actually have is effectively telling you that you failed to query data so $row doesn't contain any valid results (it contains false). It is likely caused by the syntactical issue with the ==, but you should check the results of a query as well using mysql_query($sqlz) or die(mysql_error()); which will inform you of syntactical issues. This way you can tell if the query is bad or if it returns no matching results.
Fou-Lu is offline   Reply With Quote
Old 10-01-2012, 03:53 PM   PM User | #3
urhelper
New to the CF scene

 
Join Date: Oct 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
urhelper is an unknown quantity at this point
thanks for your help ,
i need help with user_id = '{$member_id['user_id']}
how can i select user id of user who is login means what i have to put insteed {$member_id['user_id']
which file i have to include
urhelper is offline   Reply With Quote
Old 10-01-2012, 04:52 PM   PM User | #4
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,649
Thanks: 4
Thanked 2,450 Times in 2,419 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Quote:
Originally Posted by urhelper View Post
thanks for your help ,
i need help with user_id = '{$member_id['user_id']}
how can i select user id of user who is login means what i have to put insteed {$member_id['user_id']
which file i have to include
I haven't a clue what this would be. You'll need to consult the documentation or support forums of the software in order to determine what that variable should be.
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Tags
datalife engine, money, pay per post

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:18 PM.


Advertisement
Log in to turn off these ads.