Jump to content

connect to mssql then display results found


jjmusicpro

Recommended Posts

hey everyone im new at this...

 

thanks again for the help

 

i wanted to connect to my msql database and get team name, and team captain, and have it display it out, in an echo statment, however, im not sure how to do this, since i alreayd have an echo stament displaying the table.

 

thanks again for the help.

 

this is what i have so far.

 

function DisplayInfo(){
    global $sitename, $module_name;
    include_once("header.php");
include_once("conn.php");
include_once("open.php");
    title("$sitename "._STATS."");
    opentable();
    echo "<br />";
echo "<center>";
echo "<table width=\"46%\" border=\"0\">
  <tr>
    <td width=\"45%\" valign=\"top\"><strong>Teams Signed up</strong><P> 
<p>
<form id=\"form1\" name=\"form1\" method=\"post\" action=\"\">
Sign up your team!<br />
Team Name:
<label>
<input type=\"text\" name=\"team_name\" />
</label>
<br />
Team Captain:
<label>
<input type=\"text\" name=\"team_captain\" />
</label>
<br />
Phone Number:
<label>
<input type=\"text\" name=\"phone_number\" />
</label>
<br />
Email:
<label>
<input type=\"text\" name=\"email_address\" />
</label>
<br />
<label>
<input type=\"submit\" name=\"Submit\" value=\"Submit\" />
</label>
</form>

</strong></td>
    <td colspan=\"2\" rowspan=\"2\"> </td>
    <td width=\"51%\"><strong>Players (With no Teams) <br />
    </strong>If you want to joing the fun, sign up here.<p>

<form id=\"form1\" name=\"form1\" method=\"post\" action=\"\">
If you dont have a team, but want to play, sign up here!<br />
Player Name:
<label>
<input type=\"text\" name=\"player_name\" />
</label>
<br />
Phone Number:
<label>
<input type=\"text\" name=\"phone_number\" />
</label>
<br />
Player Email.
<label>
<input type=\"text\" name=\"player_email\" />
</label>
<br />
<label>
<input type=\"submit\" name=\"Submit\" value=\"Submit\" />
</label>
</form>

Link to comment
Share on other sites

I wnated to add this but dont know where

 

<?php
$db = mysql_connect("localhost", "pump_user","xxxx") or die("Could not connect."); // Connection to DB
if(!$db) 
die("no db");
if(!mysql_select_db("2008pump",$db))
die("No database selected."); 
$acc1="SELECT * from ID";
$acc2=mysql_query($acc1) or die("Could not select accounts."); // Error if nothing is selected
$i = 1;
while($acc3=mysql_fetch_assoc($acc2)) 

  $teamname = $acc3[Team_Name]; 
  $Captain_Name = $acc3[Captain_Name]; 
  i++;
  
  echo =" $i . '$teamname' . ' ' . '$Captain_Name'";
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.