+ Reply to Thread
Results 1 to 4 of 4

Thread: Need Some Help with PHP

  1. #1
    dharmil's Avatar
    dharmil is offline x10 Elder dharmil is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Avenel New Jersey
    Posts
    828

    Need Some Help with PHP

    ok here is the cod e cany any one find a problem with it and tell me my it doent work

    PHP Code:
    <?php
    if (!isset($_POST['tut']) && $_GET['sel'] != "") {
    $query "SELECT * FROM tutorial WHERE id = '$sel'";
    $result mysql_query($query);
    while(
    $r=mysql_fetch_array($result))
    {
    $news TRUE;
    echo 
    "$r[name]<br />
    $r[type]";
    $tutr wordwrap($r[disc]);
    $tutr bbcode(nl2br("$tutr"));
    echo 
    ''.$tutr.'';

                if (
    $profile[username] != "") {
    echo 
    '<a href="admin_tutorial.php?act=edit&uid='.$r[id].'">Edit</a> <a href="admin_tutorial.php?act=remove&uid='.$r[id].'">Delete</a><br />';
    } else { echo 
    '<br />'; }
    }
    if (!
    $news) {
    echo 
    "Error<br>";
    echo 
    'All The tutorial Items Were Removed';
    if (
    $profile[username] != "") {
    echo 
    ' | <a href="admin_tutorial.php?act=post">Add tutorial</a>';
    }
    }
    }
    ?>
    and to view the content i do ?sel=9 but it doesnt work

  2. #2
    dharmil's Avatar
    dharmil is offline x10 Elder dharmil is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Avenel New Jersey
    Posts
    828

    Re: Need Some Help with PHP

    admin can close this i figured out the problem with help from Chris S

  3. #3
    TheJeffsta's Avatar
    TheJeffsta is offline x10 Lieutenant TheJeffsta is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    New Zealand
    Posts
    492

    Re: Need Some Help with PHP

    It might be useful incase some other member/s has/have the same problem, to post what you did you correct it and/or post the corrected code.

    Just an opinion, but seems quite logical and helpful for others - but since its just me saying it, then you dont have to :P
    TheJeffsta (Jeffrey N)

    "No matter how much you try, the end result will always end up the way you DO NOT want it!"

  4. #4
    dharmil's Avatar
    dharmil is offline x10 Elder dharmil is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Avenel New Jersey
    Posts
    828

    Re: Need Some Help with PHP

    to fix i set the varible $sel
    PHP Code:
     <?php
    if (!isset($_POST['tut']) && $_GET['sel'] != "") {
    $sel $_GET['sel'];
    $query "SELECT * FROM tutorial WHERE id = '$sel'";
    $result mysql_query($query);
    while(
    $r=mysql_fetch_array($result))
    {
    $news TRUE;
    echo 
    "$r[name]<br />
    $r[type]";
    $tutr wordwrap($r[disc]);
    $tutr bbcode(nl2br("$tutr"));
    echo 
    ''.$tutr.'';

                if (
    $profile[username] != "") {
    echo 
    '<a href="admin_tutorial.php?act=edit&uid='.$r[id].'">Edit</a> <a href="admin_tutorial.php?act=remove&uid='.$r[id].'">Delete</a><br />';
    } else { echo 
    '<br />'; }
    }
    if (!
    $news) {
    echo 
    "Error<br>";
    echo 
    'All The tutorial Items Were Removed';
    if (
    $profile[username] != "") {
    echo 
    ' | <a href="admin_tutorial.php?act=post">Add tutorial</a>';
    }
    }
    }
    ?>

+ Reply to Thread

Similar Threads

  1. [PHP] MySQL and PHP
    By Bryon in forum Tutorials
    Replies: 43
    Last Post: 03-24-2011, 07:27 AM
  2. [PHP] Variables in PHP
    By Bryon in forum Tutorials
    Replies: 15
    Last Post: 01-29-2009, 09:46 AM
  3. tons of PHP Resources
    By Chris S in forum Scripts & 3rd Party Apps
    Replies: 10
    Last Post: 01-16-2009, 10:07 AM
  4. [PHP] PHP For Starters
    By Complex in forum Tutorials
    Replies: 24
    Last Post: 06-14-2008, 11:40 PM
  5. Unstand PHP?
    By o0slowpaul0o in forum Tutorials
    Replies: 8
    Last Post: 01-07-2008, 09:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers