Jump to content

Gem

Members
  • Posts

    129
  • Joined

  • Last visited

Posts posted by Gem

  1. Hi

     

    Try something like this for your process.php file..

     

    Change the connection details, database name, tablename and add the rest of the values (Where I put ETC ETC ... sorry, I was being lazy)

     

    Hope that help a little bit

     

    Gem

     

     

     

    <?php
    $con = mysql_connect("HOST","USER","PASSWORD");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }mysql_select_db("DATABASE NAME", $con);$sql="INSERT INTO tablename (player, position, player_no, team, ETC ETC)
    VALUES
    ('$_POST[player]', '$_POST[position]', '$_POST[player_no]'), ETC ETC";
    
    if (!mysql_query($sql,$con))
      {
      die('Error: ' . " $sql " . mysql_error());
      }
    echo "1 record added";mysql_close($con)
    ?>

  2. Hiya

     

    Trying to build a script that will list titles and subtitles, and when you click on the title, you see title, subtitle and ARTICLE ... and its not working very well ...

     

    I think im getting close though ... I have very limited knowledge of PHP so im doing alot of trial and error lol

     

    This is what is happening when I load the page (Note the error at the bottom)

     

    www.bradleystokejudoclub.co.uk/test.php

     

    And heres the code (Line 15 is $currentpage = $_GET('currentpage'); )

     

    Hope you can help =)

     

    <?php
    // database connection info
    $conn = mysql_connect("80.94.196.33","USER_INFO") or trigger_error("SQL", E_USER_ERROR);
    $db = mysql_select_db('bssql',$conn) or trigger_error("SQL", E_USER_ERROR);
    
    $result = mysql_query ("SELECT title, subtitle, article FROM articles ORDER BY ID DESC");
    while(list($title, $subtitle, $article) = mysql_fetch_row($result))
    {
        echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$title'>$title</a><BR />";
    echo $subtitle;
    echo "<BR />";
    echo "<BR />";
    
    } 
    $currentpage = $_GET('currentpage');
    
    if ($currentpage = $title)
    {
    echo $title;
    echo "<BR />";
    echo $subtitle;
    echo "<BR />";
    echo nl2br($article);
    echo "<BR />";
    }
    else
    {
    echo "ERROR";
    }
    
    ?>

  3. Hi ..  anyone know what that means??

     

    When the code below loads, I get a link for Resource Id # 2 ???

     

    <?php
    // database connection info
    $conn = mysql_connect("80.94.196.33","user","password") or trigger_error("SQL", E_USER_ERROR);
    $db = mysql_select_db('bssql',$conn) or trigger_error("SQL", E_USER_ERROR);
    
    
    
    $title = mysql_query ("SELECT title, subtitle FROM articles ORDER BY ID DESC");
    
     echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$title'>$title</a>"; 
    ?>

  4. I wonder if you can help

     

    I have a table (id, title, subtitle, article) and at the moment, I have each "row" displayed on a different "page" using the pagination codeI found.  This works great but I want to change it.

     

    Basically what I want to do is on the news.php page, is list titles/subtitle ... and when you click on the title, you are moved to the article itself ...  Hope that makes sense.

     

    Im really new to php and im learning as I go ... can anyone help me out with how I code it to do that?

     

    Thanks a million

     

    Gem

     

    OK heres what I have so far:

     

    www.bradleystokejudoclub.co.uk/news.php

     

    and heres the code:

     

    <?php
    // database connection info
    $conn = mysql_connect("80.94.196.33","USER","PASSWORD") or trigger_error("SQL", E_USER_ERROR);
    $db = mysql_select_db('bssql',$conn) or trigger_error("SQL", E_USER_ERROR);
    
    // find out how many rows are in the table 
    $sql = "SELECT COUNT(*) FROM articles";
    $result = mysql_query($sql, $conn) or trigger_error("SQL", E_USER_ERROR);
    $r = mysql_fetch_row($result);
    $numrows = $r[0];
    
    // number of rows to show per page
    $rowsperpage = 1;
    // find out total pages
    $totalpages = ceil($numrows / $rowsperpage);
    
    // get the current page or set a default
    if (isset($_GET['currentpage']) && is_numeric($_GET['currentpage'])) {
       // cast var as int
       $currentpage = (int) $_GET['currentpage'];
    } else {
       // default page num
       $currentpage = 1;
    } // end if
    
    // if current page is greater than total pages...
    if ($currentpage > $totalpages) {
       // set current page to last page
       $currentpage = $totalpages;
    } // end if
    // if current page is less than first page...
    if ($currentpage < 1) {
       // set current page to first page
       $currentpage = 1;
    } // end if
    
    // the offset of the list, based on current page 
    $offset = ($currentpage - 1) * $rowsperpage;
    
    // get the info from the db 
    $sql = "SELECT title, subtitle, article FROM articles ORDER BY ID DESC LIMIT $offset, $rowsperpage";
    $result = mysql_query($sql, $conn) or trigger_error("SQL", E_USER_ERROR);
    
    // while there are rows to be fetched...
    while ($list = mysql_fetch_assoc($result)) {
       // echo data
      ?><H2><?php echo nl2br($list['title']); ?> </H2>
        <H3><?php echo nl2br($list['subtitle']); ?> </H3>
            <?php echo nl2br($list['article']);
                  echo "<br />##########################################";
                  echo "<br /><br />";
    } // end while
    
    /******  build the pagination links ******/
    // range of num links to show
    $range = 4;
    
    // if not on page 1, don't show back links
    if ($currentpage > 1) {
       // show << link to go back to page 1
       echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=1'><<</a> ";
       // get previous page num
       $prevpage = $currentpage - 1;
       // show < link to go back to 1 page
       echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$prevpage'><</a> ";
    } // end if 
    
    // loop to show links to range of pages around current page
    for ($x = ($currentpage - $range); $x < (($currentpage + $range) + 1); $x++) {
       // if it's a valid page number...
       if (($x > 0) && ($x <= $totalpages)) {
          // if we're on current page...
          if ($x == $currentpage) {
             // 'highlight' it but don't make a link
             echo " [<b>$x</b>] ";
          // if not current page...
          } else {
             // make it a link
     echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$x'>$x</a> ";
          } // end else
       } // end if 
    } // end for
    
    // if not on last page, show forward and last page links	
    if ($currentpage != $totalpages) {
       // get next page
       $nextpage = $currentpage + 1;
        // echo forward link for next page 
       echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$nextpage'>></a> ";
       // echo forward link for lastpage
       echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$totalpages'>>></a> ";
    } // end if
    /****** end build pagination links ******/
    ?>

     

  5. I wonder if you can help

     

    I have a table (id, title, subtitle, article) and at the moment, I have each "row" displayed on a different "page" using the pagination codeI found.  This works great but I want to change it.

     

    Basically what I want to do is on the news.php page, is list titles/subtitle ... and when you click on the title, you are moved to the article itself ...  Hope that makes sense.

     

    Im really new to php and im learning as I go ... can anyone help me out with how I code it to do that?

     

    Thanks a million

     

    Gem

     

    OK heres what I have so far:

     

    www.bradleystokejudoclub.co.uk/news.php

     

    and heres the code:

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>::Bradley Stoke Judo Club::News::</title>
    <meta name="keywords" content="judo, bradley, stoke, bradley stoke, judo club, club" />
    <meta name="description" content="The Website of Bradley Stoke Judo Club, Bristol, UK." />
    <link href="default.css" rel="stylesheet" type="text/css" />
    
    <style type="text/css">
    .menutitle{
    cursor:pointer;
    margin-bottom: 5px;
    background-color:#ffff00;
    color:#000000;
    width:140px;
    padding:2px;
    text-align:center;
    font-weight:bold;
    /*/*/border:1px solid #000000;/* */
    }
    
    .submenu{
    margin-bottom: 0.5em;
    text-color:#ffff00;
    font-weight:bold;
    }
    </style>
    
    <script type="text/javascript">
    
    var persistmenu="yes"
    var persisttype="sitewide"
    
    if (document.getElementById){ 
    document.write('<style type="text/css">\n')
    document.write('.submenu{display: none;}\n')
    document.write('</style>\n')
    }
    
    function SwitchMenu(obj){
    if(document.getElementById){
    var el = document.getElementById(obj);
    var ar = document.getElementById("masterdiv").getElementsByTagName("span"); 
    	if(el.style.display != "block"){ //DynamicDrive.com change
    		for (var i=0; i<ar.length; i++){
    			if (ar[i].className=="submenu") 
    			ar[i].style.display = "none";
    		}
    		el.style.display = "block";
    	}else{
    		el.style.display = "none";
    	}
    }
    }
    
    function get_cookie(Name) { 
    var search = Name + "="
    var returnvalue = "";
    if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { 
    offset += search.length
    end = document.cookie.indexOf(";", offset);
    if (end == -1) end = document.cookie.length;
    returnvalue=unescape(document.cookie.substring(offset, end))
    }
    }
    return returnvalue;
    }
    
    function onloadfunction(){
    if (persistmenu=="yes"){
    var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
    var cookievalue=get_cookie(cookiename)
    if (cookievalue!="")
    document.getElementById(cookievalue).style.display="block"
    }
    }
    
    function savemenustate(){
    var inc=1, blockid=""
    while (document.getElementById("sub"+inc)){
    if (document.getElementById("sub"+inc).style.display=="block"){
    blockid="sub"+inc
    break
    }
    inc++
    }
    var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
    var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
    document.cookie=cookiename+"="+cookievalue
    }
    
    if (window.addEventListener)
    window.addEventListener("load", onloadfunction, false)
    else if (window.attachEvent)
    window.attachEvent("onload", onloadfunction)
    else if (document.getElementById)
    window.onload=onloadfunction
    
    if (persistmenu=="yes" && document.getElementById)
    window.onunload=savemenustate
    
    </script>
    <SCRIPT LANGUAGE="JavaScript">
    function loadImages() {
    if (document.getElementById) {  // DOM3 = IE5, NS6
    document.getElementById('hidepage').style.visibility = 'hidden';
    }
    else {
    if (document.layers) {  // Netscape 4
    document.hidepage.visibility = 'hidden';
    }
    else {  // IE 4
    document.all.hidepage.style.visibility = 'hidden';
          }
       }
    }
    
    </script>
    
    
    </head>
    <BODY OnLoad="loadImages()">
    <div id="hidepage" style="position: absolute; left:300px; top:150px; right:5px; bottom:5px; background-color:  	#FFFF00; layer-background-color: #FFFFCC; height: 50%; width: 50%;"> 
    
    <table width=100%><tr><td><font size="5" face="ariel"><BR><BR><CENTER><IMG SRC="images/bradstokelogo.jpg" width="110" height="120"><BR>Welcome to Bradley Stoke Judo Club <BR>Please Wait whilst this page loads ...</CENTER></font></td></tr></table></div>
    
    
    <div id="wrapper">
    <div id="header">
    	<h1></h1>
    	<h2></h2>
    	<hr />
    </div>
    <div id="content">
    	<div id="content1">
    		<div id="post-1" class="post">
    			<h2 class="title">
    !Celebrating Our 10th Anniversary - 2009!</h2>
    			<div class="entry">
    <center>
    <H1>Latest News</H1><BR>
    Use the Navigation Links at the bottom of this article to read through other entries...
    <BR><BR>
    <?php
    // database connection info
    $conn = mysql_connect("80.94.196.33","USERNAME","PASSWORD") or trigger_error("SQL", E_USER_ERROR);
    $db = mysql_select_db('bssql',$conn) or trigger_error("SQL", E_USER_ERROR);
    
    // find out how many rows are in the table 
    $sql = "SELECT COUNT(*) FROM articles";
    $result = mysql_query($sql, $conn) or trigger_error("SQL", E_USER_ERROR);
    $r = mysql_fetch_row($result);
    $numrows = $r[0];
    
    // number of rows to show per page
    $rowsperpage = 1;
    // find out total pages
    $totalpages = ceil($numrows / $rowsperpage);
    
    // get the current page or set a default
    if (isset($_GET['currentpage']) && is_numeric($_GET['currentpage'])) {
       // cast var as int
       $currentpage = (int) $_GET['currentpage'];
    } else {
       // default page num
       $currentpage = 1;
    } // end if
    
    // if current page is greater than total pages...
    if ($currentpage > $totalpages) {
       // set current page to last page
       $currentpage = $totalpages;
    } // end if
    // if current page is less than first page...
    if ($currentpage < 1) {
       // set current page to first page
       $currentpage = 1;
    } // end if
    
    // the offset of the list, based on current page 
    $offset = ($currentpage - 1) * $rowsperpage;
    
    // get the info from the db 
    $sql = "SELECT title, subtitle, article FROM articles ORDER BY ID DESC LIMIT $offset, $rowsperpage";
    $result = mysql_query($sql, $conn) or trigger_error("SQL", E_USER_ERROR);
    
    // while there are rows to be fetched...
    while ($list = mysql_fetch_assoc($result)) {
       // echo data
      ?><H2><?php echo nl2br($list['title']); ?> </H2>
        <H3><?php echo nl2br($list['subtitle']); ?> </H3>
            <?php echo nl2br($list['article']);
                  echo "<br />##########################################";
                  echo "<br /><br />";
    } // end while
    
    /******  build the pagination links ******/
    // range of num links to show
    $range = 4;
    
    // if not on page 1, don't show back links
    if ($currentpage > 1) {
       // show << link to go back to page 1
       echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=1'><<</a> ";
       // get previous page num
       $prevpage = $currentpage - 1;
       // show < link to go back to 1 page
       echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$prevpage'><</a> ";
    } // end if 
    
    // loop to show links to range of pages around current page
    for ($x = ($currentpage - $range); $x < (($currentpage + $range) + 1); $x++) {
       // if it's a valid page number...
       if (($x > 0) && ($x <= $totalpages)) {
          // if we're on current page...
          if ($x == $currentpage) {
             // 'highlight' it but don't make a link
             echo " [<b>$x</b>] ";
          // if not current page...
          } else {
             // make it a link
     echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$x'>$x</a> ";
          } // end else
       } // end if 
    } // end for
    
    // if not on last page, show forward and last page links	
    if ($currentpage != $totalpages) {
       // get next page
       $nextpage = $currentpage + 1;
        // echo forward link for next page 
       echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$nextpage'>></a> ";
       // echo forward link for lastpage
       echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$totalpages'>>></a> ";
    } // end if
    /****** end build pagination links ******/
    ?>					
    			</div>
    
    			<div class="hr">
    				<hr />
    			</div>
    		</div>
    		<!-- end #post-1 -->
    
    
    		<!-- end #post-2 -->
    	</div>
    	<!-- end #blog -->
    	<div id="sidebar">
    		<ul>
    			<li id="search">
    				<h2>Navigate the Site</h2>
    				<BR>
    				<div id="masterdiv" align="center">
    
    <div class="menutitle" onclick="SwitchMenu('sub1')">About BSJC</div>
    <span class="submenu" id="sub1">
    	<a href="aboutus.php">About Us</a><br>
    	<a href="joinus.php">Join Us</a><br>
    
    </span>
    
    <div class="menutitle" onclick="SwitchMenu('sub2')">Contact Us</div>
    <span class="submenu" id="sub2">
    	<a href="contact.php">Contact Form</a><br>
    	<a href="guestbook/gbook.php" target="_new">Guestbook</a><br>
    	<a href="mailto:gemmamgale@hotmail.com">Email Webmaster</a>
    </span>
    
    <div class="menutitle" onclick="SwitchMenu('sub3')">Club News</div>
    <span class="submenu" id="sub3">
    	<a href="news.php">News</a><br>
            <a href="diary.php">Diary</a><br>
                    <a href="roh.php">Roll of Honour</a>
            </span>
            
            <div class="menutitle" onclick="SwitchMenu('sub4')">Members Stuff</div>
    <span class="submenu" id="sub4">
    	<a href="grading.php">Grading Information</a><br>
            <a href="rules.php">Club Rules</a><br>
    		<a href="videos.php">Videos</a>
            </span>
    
    <div class="menutitle" onclick="SwitchMenu('sub5')">Gallery</div>
    <span class="submenu" id="sub5">
    	<a href="jalbum/" target="_new">2008-2009 Pictures</a><br>
    	<a href="archivegallery.php">Archived Pictures</a>
            </span>
    
            <div class="menutitle" onclick="SwitchMenu('sub6')">Merchandise</div>
    <span class="submenu" id="sub6">
    	<a href="merchandise.php">Price List</a><br>
    	<a href="orderform.php">Order</a>
    </span>
    
            <div class="menutitle" onclick="SwitchMenu('sub7')">Special Needs</div>
    <span class="submenu" id="sub7">
    	- <a href="http://www.specialneeds.bradleystokejudoclub.co.uk/" target="main">Special Needs Website</a><br>
    
            </span>
    
            
    
            <div class="menutitle" onclick="SwitchMenu('sub8')">Links</div>
    <span class="submenu" id="sub8">
    	- <a href="http://www.britishjudo.org.uk" target="_blank">British Judo Association</a><br>
    	- <a href="http://www.judoinfo.com" target="_blank">Judoinfo.com</a><br>
    	- <a href="http://www.judoforum.com" target="_blank">Judoforum.com</a><br>
    	- <a href="links.php">Other</a>
    </span>
    
    </div>
    
    
    
    			</li>
    			<!-- end navigation -->
    			<li id="archives" align="center">
    			<h2>Quick Links</h2>	
    <ul>
    <a href="index.php"><H3>Home</H3></a>
    <a href="guestbook/gbook.php" target="_new"><H3>Guest Book</H3></a>
    <a href="forum"><H3>BSJC Forum</H3></a>
    <BR>
    </ul>
    
    
    			</li>
    			<!-- end #archives -->
    			<li id="categories">
    				<h2>Member Club 2009</h2>
                            <ul>
    <CENTER>
    <IMG SRC="images/BJA.jpg">
    </CENTER>	
    		</ul>				
    
    
    			</li>
    			<!-- end #categories -->
    			<li id="blogroll">
    				<h2>Sponsered By</h2>
    			<center><IMG SRC="images/proemblogo.jpg"></center>	
    			</li>
    			<!-- end #blogroll -->
    
    		</ul>
    	</div>
    	<!-- end #sidebar -->
    	<div style="clear: both; height: 1px;"></div>
    </div>
    <!-- end #content -->
    <div id="footer">
    	<p>© Copyright 2009 Bradley Stoke Judo Club. Site designed by Gem Gale - <A HREF="contact.php">Contact</A>
    </div>
    </div>
    <!-- end #wrapper -->
    </body>
    </html>

  6. Hiya ..

     

    I'm getting an error but I dont know why. This code works on another page and all I did was change the names of the table and columns?!

     

    Any ideas??

     

    The table is sn_articles and columns: sn_id, sn_title, sn_subtitle, sn_article.

    Thanks

    <?php
    // database connection info
    $conn = mysql_connect(" =) ") or trigger_error("SQL", E_USER_ERROR);
    $db = mysql_select_db('bssql',$conn) or trigger_error("SQL", E_USER_ERROR);
    
    // find out how many rows are in the table 
    $sql = "SELECT COUNT(*) FROM sn_articles";
    $result = mysql_query($sql, $conn) or trigger_error("SQL", E_USER_ERROR);
    $r = mysql_fetch_row($result);
    $numrows = $r[0];
    
    // number of rows to show per page
    $rowsperpage = 1;
    // find out total pages
    $totalpages = ceil($numrows / $rowsperpage);
    
    // get the current page or set a default
    if (isset($_GET['currentpage']) && is_numeric($_GET['currentpage'])) {
       // cast var as int
       $currentpage = (int) $_GET['currentpage'];
    } else {
       // default page num
       $currentpage = 1;
    } // end if
    
    // if current page is greater than total pages...
    if ($currentpage > $totalpages) {
       // set current page to last page
       $currentpage = $totalpages;
    } // end if
    // if current page is less than first page...
    if ($currentpage < 1) {
       // set current page to first page
       $currentpage = 1;
    } // end if
    
    // the offset of the list, based on current page 
    $offset = ($currentpage - 1) * $rowsperpage;
    
    // get the info from the db 
    $sql = "SELECT sn_title, sn_subtitle, sn_article FROM sn_articles ORDER BY ID DESC LIMIT $offset, $rowsperpage";
    $result = mysql_query($sql, $conn) or trigger_error("SQL", E_USER_ERROR);
    
    // while there are rows to be fetched...
    while ($list = mysql_fetch_assoc($result)) {
       // echo data
      ?><H2><?php echo nl2br($list['sn_title']); ?> </H2>
        <H3><?php echo nl2br($list['sn_subtitle']); ?> </H3>
            <?php echo nl2br($list['sn_article']);
                  echo "<br />##########################################";
                  echo "<br /><br />";
    } // end while
    
    /******  build the pagination links ******/
    // range of num links to show
    $range = 4;
    
    // if not on page 1, don't show back links
    if ($currentpage > 1) {
       // show << link to go back to page 1
       echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=1'><<</a> ";
       // get previous page num
       $prevpage = $currentpage - 1;
       // show < link to go back to 1 page
       echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$prevpage'><</a> ";
    } // end if 
    
    // loop to show links to range of pages around current page
    for ($x = ($currentpage - $range); $x < (($currentpage + $range) + 1); $x++) {
       // if it's a valid page number...
       if (($x > 0) && ($x <= $totalpages)) {
          // if we're on current page...
          if ($x == $currentpage) {
             // 'highlight' it but don't make a link
             echo " [<b>$x</b>] ";
          // if not current page...
          } else {
             // make it a link
     echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$x'>$x</a> ";
          } // end else
       } // end if 
    } // end for
    
    // if not on last page, show forward and last page links	
    if ($currentpage != $totalpages) {
       // get next page
       $nextpage = $currentpage + 1;
        // echo forward link for next page 
       echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$nextpage'>></a> ";
       // echo forward link for lastpage
       echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$totalpages'>>></a> ";
    } // end if
    /****** end build pagination links ******/
    ?>

     

    Error: PHP Fatal error: SQL in d:\webspace\bradleystokejudoclub.co.uk\wwwroot\specialneeds\news.php on line 189

     

    I think line 189 is:

    // get the info from the db 
    $sql = "SELECT sn_title, sn_subtitle, sn_article FROM sn_articles ORDER BY ID DESC LIMIT $offset, $rowsperpage";
    $result = mysql_query($sql, $conn) or trigger_error("SQL", E_USER_ERROR);
    

  7. Hiya

     

    Can anyone help me with the code to upload a photo path into my sql table?

     

    I have no idea where to start ...

     

    I will need to then display the photos on another page..

     

    Help!!

     

    Thanks

     

    Gem

  8. Hey Jordan - Its cool man, pinacola mixed us up ...

     

    I know its bad .. but ya know ... Im a kid at heart and it had to be tried!!

     

    God is mighty p'ssed at me though ... check out this email ..

     

    Date: Fri, 20 Mar 2009 16:57:39 -0600

    To: gemmamgale@hotmail.com

    Subject: You're screwed up

    From: lesbianchick123@heaven.gov

     

    I don't know what to say. The truth is I disapprove of your decision to meddle with the fragile balance of email. You have your own mother very confused right now, and for what? Do you not know what I'm talking about? I'm speaking in regards to THIS:

     

    Just thought i would tell you that you are the best in the whole wide world xxxxxxx

     

    This sort of behavior puts people in hell. What goes around comes around.

     

    -God

     

    Can you believe it ... God is ACTUALLY a lesbian ... I knew it!!! I'm gunna be good for the rest of my life so I go to heaven!!!  ;)

     

    Gem x

     

    Disclaimer: I in no way mean to offend anyone religious or anything like that, and neither do I approve of spam!  ;D

  9. LOL - Thanks mate.

     

    Only works if I do this: echo nl2br($date); ?> </H3>

     

    I'm very new to this game (like I only started a week ago!) I'm learning as I'm doing ...

     

    I don't really know what I'm doing at all LOL

     

    Thanks for your help though ...

     

    Is there anywhere with DO/DON'Ts on formatting code???

     

    XXXXX

  10. Ummm ... please would someone take a look at this... I think I messed it up...

    <?php
    // assumes all the data for the current year is to be retrieved
    $con = mysql_connect("80.94.196.33","gem","landseer");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
    }
    mysql_select_db("bssql", $con);
    
    $result = mysql_query(
    "select *,MONTHNAME(date) as mn from diary 
    where year(date) = year(curdate()) order by date");
    
    $previous_month = ""; // initialize variable to detect change in month name
    while($row = mysql_fetch_array($result))
    {
    if($row['mn'] != $previous_month){
    	?><H1><?php echo $row['mn'] . '<br />'; ?> </H1> <?php
    	$previous_month = $row['mn'];
    }
      ?><H2><?php echo nl2br($row['event']); ?> </H2>
        <H3><?php $date = explode("-",$row['date']);
                  $date = date("jS F Y",mktime(0,0,0,$date[1],$date[2],$date[0]));
                  echo nl2br '.$date.'; ?> </H3>
            <?php echo nl2br($row['details']);
                  echo "<br />##########################################";
                  echo "<br /><br />";
    }
    
    
    
    ?>

     

    Error: PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in d:\webspace\bradleystokejudoclub.co.uk\wwwroot\diary.php on line 171

     

    Line 171 is: echo nl2br '.$date.'; ?> </H3> (supposidly!)

     

    Any ideas what I've done, or more importantly ... how I fix it???

     

    Thanks a million ... x

     

  11. hmmmmm ... excuse my ignorance...

    <?php 
    mysql_select_db("bssql", $con);
    $result = mysql_query("SELECT `event`, `date` FROM `diary` ORDER BY date DESC LIMIT 5") or die(mysql_error());
    while($row = mysql_fetch_assoc($result))
    {
        ?><b><a href="diary.php"><?php echo $row['event'];?></a></b> 
        <BR><?php echo $row['date']?><BR><BR><?php
    }
    mysql_close($con);
    ?>

     

    Where would I put that??? ... ??? ;D

  12. Hiya ...

     

    I need a script that does this .. but doesn't time out.

     

    I knew it wouldn't like it but I dont know how to do it so thought I'd give it ago anyway and see what happens ...

     

    Any ideas??

     

    January
    <?php
    $con = mysql_connect("80.94.196.33","gem","landseer");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
    }
    mysql_select_db("bssql", $con);$result = mysql_query(
    "select * from diary 
    where date between date '2009-01-01'
    and date '2009-01-31';");while($row = mysql_fetch_array($result))
      {
      ?><H2><?php echo nl2br($row['event']); ?> </H2>
        <H3><?php echo nl2br($row['date']); ?> </H3>
            <?php echo nl2br($row['details']);
                  echo "<br />##########################################";
                  echo "<br /><br />";
      }mysql_close($con);
    ?>
    February
    <?php
    $con = mysql_connect("80.94.196.33","gem","landseer");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
    }
    mysql_select_db("bssql", $con);$result = mysql_query(
    "select * from diary 
    where date between date '2009-02-01'
    and date '2009-02-28';");while($row = mysql_fetch_array($result))
      {
      ?><H2><?php echo nl2br($row['event']); ?> </H2>
        <H3><?php echo nl2br($row['date']); ?> </H3>
            <?php echo nl2br($row['details']);
                  echo "<br />##########################################";
                  echo "<br /><br />";
      }mysql_close($con);
    ?>
    March
    <?php
    $con = mysql_connect("80.94.196.33","gem","landseer");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
    }
    mysql_select_db("bssql", $con);$result = mysql_query(
    "select * from diary 
    where date between date '2009-03-01'
    and date '2009-03-31';");while($row = mysql_fetch_array($result))
      {
      ?><H2><?php echo nl2br($row['event']); ?> </H2>
        <H3><?php echo nl2br($row['date']); ?> </H3>
            <?php echo nl2br($row['details']);
                  echo "<br />##########################################";
                  echo "<br /><br />";
      }mysql_close($con);
    ?>
    April
    <?php
    $con = mysql_connect("80.94.196.33","gem","landseer");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
    }
    mysql_select_db("bssql", $con);$result = mysql_query(
    "select * from diary 
    where date between date '2009-04-01'
    and date '2009-04-30';");while($row = mysql_fetch_array($result))
      {
      ?><H2><?php echo nl2br($row['event']); ?> </H2>
        <H3><?php echo nl2br($row['date']); ?> </H3>
            <?php echo nl2br($row['details']);
                  echo "<br />##########################################";
                  echo "<br /><br />";
      }mysql_close($con);
    ?>
    May
    <?php
    $con = mysql_connect("80.94.196.33","gem","landseer");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
    }
    mysql_select_db("bssql", $con);$result = mysql_query(
    "select * from diary 
    where date between date '2009-05-01'
    and date '2009-05-31';");while($row = mysql_fetch_array($result))
      {
      ?><H2><?php echo nl2br($row['event']); ?> </H2>
        <H3><?php echo nl2br($row['date']); ?> </H3>
            <?php echo nl2br($row['details']);
                  echo "<br />##########################################";
                  echo "<br /><br />";
      }mysql_close($con);
    ?>
    June
    <?php
    $con = mysql_connect("80.94.196.33","gem","landseer");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
    }
    mysql_select_db("bssql", $con);$result = mysql_query(
    "select * from diary 
    where date between date '2009-06-01'
    and date '2009-06-30';");while($row = mysql_fetch_array($result))
      {
      ?><H2><?php echo nl2br($row['event']); ?> </H2>
        <H3><?php echo nl2br($row['date']); ?> </H3>
            <?php echo nl2br($row['details']);
                  echo "<br />##########################################";
                  echo "<br /><br />";
      }mysql_close($con);
    ?>
    July
    <?php
    $con = mysql_connect("80.94.196.33","gem","landseer");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
    }
    mysql_select_db("bssql", $con);$result = mysql_query(
    "select * from diary 
    where date between date '2009-07-01'
    and date '2009-07-31';");while($row = mysql_fetch_array($result))
      {
      ?><H2><?php echo nl2br($row['event']); ?> </H2>
        <H3><?php echo nl2br($row['date']); ?> </H3>
            <?php echo nl2br($row['details']);
                  echo "<br />##########################################";
                  echo "<br /><br />";
      }mysql_close($con);
    ?>
    August
    <?php
    $con = mysql_connect("80.94.196.33","gem","landseer");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
    }
    mysql_select_db("bssql", $con);$result = mysql_query(
    "select * from diary 
    where date between date '2009-08-01'
    and date '2009-08-31';");while($row = mysql_fetch_array($result))
      {
      ?><H2><?php echo nl2br($row['event']); ?> </H2>
        <H3><?php echo nl2br($row['date']); ?> </H3>
            <?php echo nl2br($row['details']);
                  echo "<br />##########################################";
                  echo "<br /><br />";
      }mysql_close($con);
    ?>
    September
    <?php
    $con = mysql_connect("80.94.196.33","gem","landseer");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
    }
    mysql_select_db("bssql", $con);$result = mysql_query(
    "select * from diary 
    where date between date '2009-09-01'
    and date '2009-09-30';");while($row = mysql_fetch_array($result))
      {
      ?><H2><?php echo nl2br($row['event']); ?> </H2>
        <H3><?php echo nl2br($row['date']); ?> </H3>
            <?php echo nl2br($row['details']);
                  echo "<br />##########################################";
                  echo "<br /><br />";
      }mysql_close($con);
    ?>
    October
    <?php
    $con = mysql_connect("80.94.196.33","gem","landseer");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
    }
    mysql_select_db("bssql", $con);$result = mysql_query(
    "select * from diary 
    where date between date '2009-10-01'
    and date '2009-10-31';");while($row = mysql_fetch_array($result))
      {
      ?><H2><?php echo nl2br($row['event']); ?> </H2>
        <H3><?php echo nl2br($row['date']); ?> </H3>
            <?php echo nl2br($row['details']);
                  echo "<br />##########################################";
                  echo "<br /><br />";
      }mysql_close($con);
    ?>
    November
    <?php
    $con = mysql_connect("80.94.196.33","gem","landseer");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
    }
    mysql_select_db("bssql", $con);$result = mysql_query(
    "select * from diary 
    where date between date '2009-11-01'
    and date '2009-11-30';");while($row = mysql_fetch_array($result))
      {
      ?><H2><?php echo nl2br($row['event']); ?> </H2>
        <H3><?php echo nl2br($row['date']); ?> </H3>
            <?php echo nl2br($row['details']);
                  echo "<br />##########################################";
                  echo "<br /><br />";
      }mysql_close($con);
    ?>
    December
    <?php
    $con = mysql_connect("80.94.196.33","gem","landseer");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
    }
    mysql_select_db("bssql", $con);$result = mysql_query(
    "select * from diary 
    where date between date '2009-12-01'
    and date '2009-12-31';");while($row = mysql_fetch_array($result))
      {
      ?><H2><?php echo nl2br($row['event']); ?> </H2>
        <H3><?php echo nl2br($row['date']); ?> </H3>
            <?php echo nl2br($row['details']);
                  echo "<br />##########################################";
                  echo "<br /><br />";
      }mysql_close($con);
    ?>

     

    Thanks

     

    X

×
×
  • 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.