Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    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.

  • #3
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    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.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •