Sponsor for PC Pals Forum

Author Topic: Request.  (Read 7435 times)

Offline Corky

  • Regular Member
  • **
  • Posts: 87
    • http://www.faceparty.com/corky_wales
Request.
« on: November 04, 2002, 08:15 »
St Adept  ;D would it be possible to have a Coding tutorial section here? PLEAAAAAASE. It may come in handy..  What do u think?
img]http://www.raid-designs.co.uk/emote/corkypc.gif[/img]

Offline bat69

  • Loyal Member
  • *****
  • Posts: 1951
    • http://members.lycos.co.uk/dbat69/
Re:Request.
« Reply #1 on: November 04, 2002, 10:25 »
I'd be happy with that as I need to learn all about it. I'm slowly learning SQL, erm I think :- and trying to understand html and php. Now trying to do all those at the same time is not helping my brain ::)
url=http://www.pc-pals.com/userpics/bat69bc.swf]Flash[/url]

Offline jimmy b

  • New Registration
  • Posts: 1
Re:Request.
« Reply #2 on: November 04, 2002, 10:27 »
I would be happy to learn all of those bat. as I need to make my own website a lot better, It is very basic at the moment.

Offline Corky

  • Regular Member
  • **
  • Posts: 87
    • http://www.faceparty.com/corky_wales
Re:Request.
« Reply #3 on: November 04, 2002, 10:28 »
sql is the easier of the lot.  When using php the most common commands are

SELECT
DELETE
UPDATE

I would be more than happy to help you out when ever you need it.

Corky
img]http://www.raid-designs.co.uk/emote/corkypc.gif[/img]

Offline bat69

  • Loyal Member
  • *****
  • Posts: 1951
    • http://members.lycos.co.uk/dbat69/
Re:Request.
« Reply #4 on: November 04, 2002, 10:31 »
Right lets start at the beginning ;)

I got a tutorial CD for SQL, which I'm slowly going through.

As for doing up your web site, I use Dreamweaver, although FirstPage 2000 is great for beginners and comes with loads of add-ins which look good. Its also free ;D  I'll post the url later when I've found it, if you want FP2000
url=http://www.pc-pals.com/userpics/bat69bc.swf]Flash[/url]

Offline jimmy b

  • New Registration
  • Posts: 1
Re:Request.
« Reply #5 on: November 04, 2002, 10:33 »
I have dreamweaver mx ;D.

Yes start right at the beginning.

Are you only doing Sql? or the others aswell.

Where you get the disk from Bat?

Offline Corky

  • Regular Member
  • **
  • Posts: 87
    • http://www.faceparty.com/corky_wales
Re:Request.
« Reply #6 on: November 04, 2002, 11:02 »
ok, the begining....

PHP:

php files must start with <?PHP or <?  lines are terminated by ; unless a { is there

to connect to MYSQL through PHP, use this code:

$connect = mysql_connect("localhost", "databaseusername", "databasepassword");//connects to the database
$select = mysql_select_db("databasename"); //selects the database

$connect is now a short name for mysql_connect("localhost", "databaseusername", "databasepassword");
and $select is a short name for mysql_select_db("databasename"); .  They may not need to be used that often, but some query's may need to use them from time to time.

Next, query's:

After typing the connect code add this code below mysql_select_db... :

$query = mysql_query("SELECT * FROM databasetable"); //selects where the data is coming from in the table.

Now, if you want to display data from the database on a page you use:

while ($row = mysql_fetch_array($query)) {

$get1 = $row["get1"];
$get2 = $row["get2"];
$get3 = $row["get3"];
//and so on.
now to display the data it has to be echo'd through php. So add:

echo"$get1";
echo"$get2";
//html can be added here, but errors will emerge if there are " (quotes) in the code, you can avoid the errors by adding a  in from of the " so for example <td height="20"> looks like this <td heigh="20">
echo"$get3";
//and so on.

now that this data has been set to echo you can close this by adding a } at the end.

now close the code with ?>

Fullcode:

<?PHP

$connect = mysql_connect("localhost", "databaseusername", "databasepassword");
$select = mysql_select_db("databasename");
$query = mysql_query("SELECT * FROM databasetable");
while ($row = mysql_fetch_array($query)) {

$get1 = $row["get1"];
$get2 = $row["get2"];
$get3 = $row["get3"];

echo"$get1";
echo"$get2";
echo"$get3";

}

?>


Right, who's still awake? ok rephrase... Who is still awake and understood a word of that?

Let me know what u are having trouble with and ill explain it more indepth.

Corky
img]http://www.raid-designs.co.uk/emote/corkypc.gif[/img]

Offline jimmy b

  • New Registration
  • Posts: 1
Re:Request.
« Reply #7 on: November 04, 2002, 11:11 »
Corky I said at the begiinning ;D.

What does each one do and what they can be used for?

A very simple tutorial on using it?

Offline Corky

  • Regular Member
  • **
  • Posts: 87
    • http://www.faceparty.com/corky_wales
Re:Request.
« Reply #8 on: November 04, 2002, 11:14 »
perhaps these ppl could teach you better.


http://www.webmasterbase.com/
img]http://www.raid-designs.co.uk/emote/corkypc.gif[/img]

Offline Corky

  • Regular Member
  • **
  • Posts: 87
    • http://www.faceparty.com/corky_wales
Re:Request.
« Reply #9 on: November 04, 2002, 11:17 »
I didn't start using php with tutorials or help.  I jumped straight in at the deep end and edidted code of other peoples work.  I didn't copy it, i used it as a guide to build my own.

I think i will have to work on my tutorial building :)
img]http://www.raid-designs.co.uk/emote/corkypc.gif[/img]

Offline jimmy b

  • New Registration
  • Posts: 1
Re:Request.
« Reply #10 on: November 04, 2002, 11:19 »

perhaps these ppl could teach you better.


http://www.webmasterbase.com/


Are ytou just trying to say "OMG he knows nothing" lol.

I am hopefully going on a dreamweaver course. Still have to sort it out though.

Offline Corky

  • Regular Member
  • **
  • Posts: 87
    • http://www.faceparty.com/corky_wales
Re:Request.
« Reply #11 on: November 04, 2002, 11:24 »
no not at all Jimmy :) I re-read what i had written, and it looked pretty confusing for me!

The people at webmasterbase have been coding for donkies years so it may be better.. So just ask me if something goes wrong ;D

Corky
img]http://www.raid-designs.co.uk/emote/corkypc.gif[/img]

Offline bat69

  • Loyal Member
  • *****
  • Posts: 1951
    • http://members.lycos.co.uk/dbat69/
Re:Request.
« Reply #12 on: November 04, 2002, 18:39 »


Where you get the disk from Bat?



A friend at work gave me it  :o

Seems quite good, but I think it will have to take a back seat now as I'm having truble with this PC and I'm loath to reformat it as I want to use it until my new machine is finished, hopefully soon.

Ohh dear Corky, seems I'm not learning fast enough, I was reading Greek there ;) I think ::)
url=http://www.pc-pals.com/userpics/bat69bc.swf]Flash[/url]

Offline Corky

  • Regular Member
  • **
  • Posts: 87
    • http://www.faceparty.com/corky_wales
Re:Request.
« Reply #13 on: November 04, 2002, 21:43 »
hehe, it was all Greek to me when i first started too but you get used to it after a while. :)
img]http://www.raid-designs.co.uk/emote/corkypc.gif[/img]

Offline bat69

  • Loyal Member
  • *****
  • Posts: 1951
    • http://members.lycos.co.uk/dbat69/
Re:Request.
« Reply #14 on: November 05, 2002, 22:35 »
Well I always hated languages at school, apart from programming that is, that was fun, especially when the teacher hadn't a clue what I was writing, it was well beyond her, hee hee
url=http://www.pc-pals.com/userpics/bat69bc.swf]Flash[/url]


Show unread posts since last visit.
Sponsor for PC Pals Forum