Inserting indiviual data from tables [SOLVED]

Hey guys,

I have a question, I want to insert information from a single cell from mysql data, this information is under my nuffraci_totals/z/ then i click on browse and this is what i see.

info like the 4.8 or the 11.1 under the avg finish.

Thanks,

sry, i haven’t unserstood that, could u reprase ur question?

Please phrase all questions in the form of a QUESTION.

No Question… No Answer! What exactly would you like to know about the info like 4.8 and 11.1?

Sorry I want to post the 4.8 and 11.1 by it self on a webpage…Is there a way to do this…

I can get the whole thing to publish to a website, but i want to narrow it down futher.

[php]
$result=mysql_query(‘SELECT avgfinish FROM z‘); while($row=mysql_fetch_assoc($result))echo $row[‘avgfinish’].’
’;
[/php]thats what u told us u wanna have!!!

but i don’t think thats realy what u want, is it?

we r all just human beeing, don’t try to get to technical, tell us what u realy try to achive.

Yeah that is what i want but i want it for individual drivers. this is what i am using it for.

http://www.nuffracingleague.com/Driver/abbotttazz.html

<?php $result=mysql_query('SELECT `avgfinish` FROM `z`'); while($row=mysql_fetch_assoc($result))echo $row['avgfinish'].'
'; ?>

Do i have to specify the row number?

now i’m confuised:

the example was showing one row.

the code i provided (and what u confirmed, to be the right thing) is showing one column

as i said, i’m confused.

Once agian i am sorry,

After looking at my website. you see that i have each stat(avg. starts, avg. finishes, wins, and etc.) All i want to do is pull each of those cells(one by one) out of the database and put them in the format on the website.

my picture shows

avgfinish | avgstart | Drivers | id| numberofqualifies | etc.

4.8…6.4…abbot…1…10…etc.
(please disregard the periods, thats the only way i could think of spreading the info out)

I want to post the 4.8 like this

4.8
but only in PHP and pull that info from the database for that specific driver

Does this help?

i’m still not 100% sure, but ithink u just wanna display one column:

if u have a page u acces throug z.php?id=1

than u need a conection to the db (hope thats no prob for u)

and then:
[php]$result=mysql_query(‘SELECT * FROM z WHERE id=’.intval($_GET[‘id’]));
if($row=mysql_fetch_assoc($result))
echo ’

'.number_format($row['avgfinish'],1).' '.number_format($row['avgstart'],1).' '.htmlentities($row['Drivers']).' '.$row['id'].' '.$row['numberofqualifiers'].' etc.
';[/php]

hope this helps. otherwise ask again.

LOL,

let me try and see if i get it right…

btw:
to create a navigation u would do this:
[php]$result=mysql_query(‘SELECT id,Drivers FROM z‘);
while($row=mysql_fetch_assoc($result))
{
echo ‘’.htmlentities($row[‘Drivers’]).’
’;
}[/php]

of cause there may have to be more html than just ‘
’ to create a nice nav

<?php $username="nuffraci_nuff"; $password="mypassword"; $database="nuffraci_totals"; mysql_connect(localhost,$username,$password); mysql_select_db($database) or die( "Unable to select database"); $result=mysql_query('SELECT * FROM `z` WHERE `id`='.intval($_GET['id'])); if($row=mysql_fetch_assoc($result)) echo '
'.number_format($row['avgfinish'],1).' '.number_format($row['avgstart'],1).' '.htmlentities($row['Drivers']).' '.$row['id'].' '.$row['numberofqualifiers'].' etc.
'; ?>

I get no error but nothing displays,

http://www.nuffracingleague.com/PHPTEST/bustersnm2.php

it workes fine: http://www.nuffracingleague.com/PHPTEST … 2.php?id=1

some better error catching would be:
[php]

$username=“nuffraci_nuff”;
$password=“mypassword”;
$database=“nuffraci_totals”;
mysql_connect(localhost,$username,$password);
mysql_select_db($database) or die( “Unable to select database”);

$result=mysql_query(‘SELECT * FROM z WHERE id=’.intval($_GET[‘id’]));
if($row=mysql_fetch_assoc($result))
echo ’

'.number_format($row['avgfinish'],1).' '.number_format($row['avgstart'],1).' '.htmlentities($row['Drivers']).' '.$row['id'].' '.$row['numberofqualifiers'].' etc.
'; else echo 'entry number '.intval($_GET['id']).' is not existing';[/php]
<?php $username="nuffraci_nuff"; $password="mypassword"; $database="nuffraci_totals"; mysql_connect(localhost,$username,$password); mysql_select_db($database) or die( "Unable to select database"); $result=mysql_query('SELECT * FROM `z` WHERE `id`='.intval($_GET['id'])); if($row=mysql_fetch_assoc($result))
Races Wins Avg. Starts Avg. Finishs Poles Top 5's Top 10's Races '.number_format($row['Races'],1).' '.number_format($row['Wins'],1).' '.htmlentities($row['avgstart']),1.' '.$row['avgfinish'],1.' '.$row['Poles'],1.' '.$row['totaltop5'],1.' '.$row['Totaltop10'],1.'
'; ?>
Sponsor our Newsletter | Privacy Policy | Terms of Service