Go Back   Novahq.net Forum > phphq.Net > phphq.Net Forums
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-02-2004, 01:11 PM
XinG
Unregistered

Posts: n/a

Databases

How would i go about making a database, and connecting to a database from within 1 page? (Eg index.php)
A database which creates:
Username
Password
*ID
D.O.B

and then use this within the site for when users register?
I have a login script too, i didn't make it, i found it from the net, how would i be able to use this to only let people who login use certain pages?
Also.. I need some help with the site im making too, at the moment i'm concentrating on constructiong the site, then design later, this is what i have at the moment:
<a href="www.no-remorseclan.com/My%20Website">HERE</a>
Reply With Quote
  #2  
Old 10-02-2004, 02:13 PM
katana*GFR* is offline katana*GFR*

Join Date: May 2002
Location: North Sea
Posts: 2,421

Send a message via ICQ to katana*GFR* Send a message via MSN to katana*GFR*
html code is disabled here Xing, use the BBcode instead. = [url] or then name* ; and as closing tag

Cant help u on the DB tho, im still learning it

And if you remove the space in your folder name you wont get the % between the words, use _ for instead.
__________________
<- Sponsored by Chris



Found on Youtube:
Quote:
And if Newton Faulkner's voice can be described as "R&B" then Kurt Cobain must be a member of Boyz II Men.
Link here
Reply With Quote
  #3  
Old 10-02-2004, 02:38 PM
PHP-Largo
Unregistered

Posts: n/a

&lt;?php
$sql = mysql_connect("host","username","password");

mysql_select_db("Db name",$sql);

$result=mysql_query("SELECT * FROM tablename");
//pull it out
while($myrow = mysql_fetch_array($result)) {
printf("$myrow[somename]");
}
?&gt;
Reply With Quote
  #4  
Old 10-02-2004, 05:01 PM
PHP-Largo
Unregistered

Posts: n/a

[quote:eca061018e="PHP-Largo"]&lt;?php
$sql = mysql_connect("host","username","password");

mysql_select_db("Db name",$sql);

$result=mysql_query("SELECT * FROM tablename");
//pull it out
while($myrow = mysql_fetch_array($result)) {
printf("$myrow[somename]");
}
?&gt;[/quote:eca061018e]
forgot: it should have the debug : here is the code:
[code:1:eca061018e]&lt;?php
$sql = mysql_connect(&quot;host&quot;,&quot;username&quot ;,&quot;password&quot;)
or die(&quot;could not connect&quot;);
mysql_select_db(&quot;Db name&quot;,$sql)
or die(&quot;could not select DataBase&quot;);


$result=mysql_query(&quot;SELECT * FROM tablename&quot;)
or die(&quot;could not execute query&quot;);
//pull it out
while($myrow = mysql_fetch_array($result)) {
printf(&quot;$myrow[somename]&quot;);
}
?&gt;[/code:1:eca061018e]
Reply With Quote
  #5  
Old 10-03-2004, 12:34 AM
PHP-Largo
Unregistered

Posts: n/a

really the query is whatever you want it to do ... just do the correct coding and it should work out fine
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Databases XinG phphq.Net Forums 13 10-08-2004 08:23 AM
moving databases G.I.JOE*MFA* Web design and Programming 4 02-11-2004 07:02 AM


All times are GMT -5. The time now is 07:08 AM.




Powered by vBulletin®