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-30-2004, 10:22 PM
XinG
Unregistered

Posts: n/a

Shoutbox

Im currently undertaking my first PHP task.. Making a ShoutBox..
So far i've pieced this together. Scott, could you tell me if it would? Possibly help me? (My server down ATM):

shout.php

<? require_once "db_connect.php"; ?>
<? require "inserting_data.php"; ?>

<form action=POST method=inserting_data.php>
<input name=name><br />
<input name=message>
</form>

$query="SELECT * FROM shoutbox";

$num=mysql_numrows($result);

$i=0;
while ($i < $num) {

$name=mysql_result($result,$i,name");
$message=mysql_result($result,$i,message");
?>


db_connect.php

<?
$user="";
$password="";
$database="localhost_test";
mysql_connect($database,$user,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="CREATE TABLE `shoutbox` (
`name` VARCHAR( 10 ) NOT NULL ,
`message` VARCHAR( 50 ) NOT NULL
)";
mysql_query($query);
mysql_close();
?>


inserting_data.php

$query = "INSERT into shoutbox VALUES (".'$name'.'$message')";


admin.php

<?
$user="";
$password="";
$database="";
mysql_connect($database,$user,$password);

$query="SELECT * FROM shoutbox WHERE name='$name'";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
?>
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
shoutbox GeeFuss Feedback / Novahq.net Support 3 01-02-2008 12:29 AM
The Shoutbox DESTROYER General Chat 7 09-19-2005 07:21 PM
Shoutbox Cody 7 Web design and Programming 5 12-08-2004 10:49 AM
SHOUTBOX darkchaos Web design and Programming 1 06-16-2003 07:28 PM
need help with shoutbox G.I.JOE*MFA* Web design and Programming 14 08-15-2002 07:51 PM


All times are GMT -5. The time now is 02:13 AM.




Powered by vBulletin®