mastercjb Posted October 28, 2009 Share Posted October 28, 2009 I was given this script however I was not told what to add in my MYSQL tables. This is part of the script I was given: <?php session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "config.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); Now this part is throwing this error: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/blt3/public_html/streets.php on line 11 This is line 11: $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); What is that trying to select? I know its trying to pull something from my users table but what? What does LEFT JOIN mean? [td][/td] Quote Link to comment https://forums.phpfreaks.com/topic/179318-hope-you-guys-can-help-me-understand-this/ Share on other sites More sharing options...
monkeybidz Posted October 28, 2009 Share Posted October 28, 2009 You may want to edit the file named "config.php" with your login and database information. Some scripts require you to do this manually or will not do it automatically during installation if file permissions or CHMODS are not set to 777 or 755. Some hosting servers change these back automatically when not allowed by the hosting comapny. Quote Link to comment https://forums.phpfreaks.com/topic/179318-hope-you-guys-can-help-me-understand-this/#findComment-946167 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.