Jump to content

WilsonC

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

WilsonC's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. What would be the most efficient way of getting the number of rows that will be returned by that?
  2. Thanks.... that certainly got me on the right track.... but what if i needed to use MATCH and AGAINST fulltext index searches on that query? WHERE should the MATCH and AGAINST be located?
  3. have 4 tables with the following fields: Story: StoryID Title StoryText Summary AuthorNo Author: AuthorNo AuthorID Comments: StoryID CommentNo Comment I want to get the values of: StoryID, Title, Summary, AuthorID, Count(CommentNo WHERE Comments.StoryID=Story.StoryID) as 1 row. The count being the "number of comments the story has". I have nearly no idea where to start. My only problem is the Count(comments) part. Any help will be appreciated, hope it was not too confusing for anyone to understand.
  4. Hi, i've been having problems with getting some sessions to work for me: Initially, i had this code: [code] <?php session_name(login_session); session_start(); include 'dataconn.php'; // Conver to simple variables $username = $_POST['username']; $password = $_POST['password']; if((!$username) || (!$password)){     echo "Please enter ALL of the information! <br />";     include 'loginform.htm';     exit(); } $sql = mysql_query("SELECT AuthorNo, AuthorID, Email FROM Author WHERE AuthorID='$username' AND Pwd='$password' AND Status='1'"); $login_check = mysql_num_rows($sql); if($login_check > 0){     $row = mysql_fetch_array($sql);     $today = time();     $MySQLdate=date(YmdHis,$today);     $_SESSION['author']=$row['AuthorNo'];     $_SESSION['sessionLogin'] = $row[AuthorID];     $_SESSION['sessionEmail'] = $row[email];     $_SESSION['sessionLogintime'] = $MySQLdate;     mysql_query("UPDATE Author SET Lastlogin='".$MySQLdate."' WHERE AuthorNo='".$_SESSION['author']."'");     echo "You have successfully logged on, ".$_SESSION['sessionLogin']." at ".$_SESSION['sessionLogintime']."" ; } else {     echo "You could not be logged in! Either the username and password do not match or you have not validated your membership!<br />         Please try again!<br />";     include 'loginform.htm'; } session_write_close(); mysql_close(); ?> [/code] The above page seemed to work perfectly fine. However, if i added a hyperlink to, say "logintester.php", and clicked on it: [code] <?php error_reporting(1); session_name(login_session); session_start(); if (isset($_SESSION['sessionLogin'])){          $login = $_SESSION['sessionLogin']; }else{          $login = "Not Set"; } echo "Welcome ". $login ." "; ?> [/code] It would return "Welcome Not Set", meaning the values of the session were not accessible on this next page. After scrounging through numerous forums and php sites, and trying various different approaches suggested by different people, i still could not get it to work. I tried testing my sessions with the following script: [code] <?php if (session_id() == "") {   session_start(); } error_reporting(1); session_register('count'); $_SESSION['count']=1; echo $_SESSION['count']; $_SESSION['count']++; echo $_SESSION['count']; echo SID; session_write_close(); ?> [/code] The first time the above script is run, it returns "12PHPSESSID=blablabla". Subsequent refreshes, however, returned just "12". I've an incredibly strong feeling that this is caused by a really stupid oversight on my part, but i'm really getting frustrated at this. Any help would be deeply appreciated. I even tried switching webhosts but to no avail. For more information i'm using Byethost and infonet.com as testing servers for this. Thanks in advance for any help anyone can give me.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.