Jump to content

  • Free consultations and support
  • Chat icoLive chatClick Here for Live Chat
  • Call ico 1888-906-1888
    Phone support: Open

    Ready for your call :)

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams

    Phone support: Closed

    We are back in: 1h 20m

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams

Mysql database

  • Please log in to reply

#1 Web_TutorNET


    Apprentice Designer

  • Designer
  • 4 posts

Posted 18 May 2004 - 10:03 AM

ok on tuts.php heres the code

$host = "localhost" ;
$user = "******" ;
$pass = "******" ;
$db = "tuts" ;
$table = "php" ;
$show_all = "SELECT * FROM $table" ;

mysql_connect ($host,$user,$pass) or die ( mysql_error ());
mysql_select_db ($db)or die ( mysql_error ());
$result = mysql_query ($show_all) or die ( mysql_error ());
while ($row = mysql_fetch_array ($result))
$view_db .= "Tutorial Name: ".$row[ "tutn" ]."<br>";
$view_db .= "Website: ".$row[ "ws" ]."<br>";
$view_db .= "Tutorial Number: ".$row[ "id" ]."<br>";
echo ( "$view_db" );


that works fine.. thats getting the information out of the database
its getting tutorial name, website, tutorial number out of it but theres tutorial in there to i dont want that listed on that page...

now showtuts.php
i dont have anything there yet.

i need to make it so that on tuts.php it shows the tutorial name as a link to showtut.php?id=1 like that if thats the tutorial number its actually the id INT

what would i put on showtuts.php to show the tutorial?

like this

Tutorial Name: Testing Name (the actual name Testing Name is a link to that tutorial
Website: that shows the persons website as a link
Tutorial #: shows the id of it

on showtuts.php i want whatever tutorial name they click on that tutorial comes up..

this is all mysql not query strings.
sorry for the long post though

#2 Derek


    Apprentice Designer

  • Designer
  • 32 posts

Posted 01 July 2004 - 10:29 AM

On showtuts.php, you'd have to do something like:
if ($id) {
$sql = "SELECT fields FROM table WHERE id = $id";
$sql2 = mysql_query($sql);
$sql3 = mysql_fetch_array($sql2);
echo "$sql3[field]";

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users