tov
05-07-2006, 01:07 AM
Hi,
I think I'm trying to learn the DB part of Php.
So far I've made a DBtable with phpMyAdmin
it has three parts...
1- ID#
2- Title
3- Body
My thinking is to retrieve and display the data on a webpage.
I made a config file - looks like this...
<?php
$host = "localhost";
$user = "xxxxxx";
$password = "xxxxxx";
$database = "abcd_soblog";
?>
Next I'm woking on the grammer and syntax but I'm having a hard time of it.
<?php
require ('config.php');
$query = "SELECT * FROM 'ablog' LIMIT 0, 30";
?>
I've tried several variations
<?php
$host = "localhost";
$user = "xxxxxx";
$password = "xxxxxx";
$database = "abcd_soblog";
$result = mysql_query("SELECT abcd _soblog * FROM ablog",$db);
printf("title: %s<br>\n", mysql_result($result,0,"first"));
printf("body: %s<br>\n", mysql_result($result,0,"last"));
?>
I've got four books and it seems they jump from a simple echo statement - to complex DB schemas. Even the online tutorials seem to skip the kind of very basic step by step - ( understanding the baby steps ) - kind of tutorial I guess I need.
I would like to see a display of...
A Big Title
bla bla ipsum epsum bla bla body of text etc...
and then maybe something like showing all four entries n the DBTable.
I'm hoping some kind person can help me get a grip on this, please.
:D
I think I'm trying to learn the DB part of Php.
So far I've made a DBtable with phpMyAdmin
it has three parts...
1- ID#
2- Title
3- Body
My thinking is to retrieve and display the data on a webpage.
I made a config file - looks like this...
<?php
$host = "localhost";
$user = "xxxxxx";
$password = "xxxxxx";
$database = "abcd_soblog";
?>
Next I'm woking on the grammer and syntax but I'm having a hard time of it.
<?php
require ('config.php');
$query = "SELECT * FROM 'ablog' LIMIT 0, 30";
?>
I've tried several variations
<?php
$host = "localhost";
$user = "xxxxxx";
$password = "xxxxxx";
$database = "abcd_soblog";
$result = mysql_query("SELECT abcd _soblog * FROM ablog",$db);
printf("title: %s<br>\n", mysql_result($result,0,"first"));
printf("body: %s<br>\n", mysql_result($result,0,"last"));
?>
I've got four books and it seems they jump from a simple echo statement - to complex DB schemas. Even the online tutorials seem to skip the kind of very basic step by step - ( understanding the baby steps ) - kind of tutorial I guess I need.
I would like to see a display of...
A Big Title
bla bla ipsum epsum bla bla body of text etc...
and then maybe something like showing all four entries n the DBTable.
I'm hoping some kind person can help me get a grip on this, please.
:D