WHAT DO YOU WANT?

  • Thread starter Thread starter Knightjester
  • Start date Start date
  • Christian Chat is a moderated online Christian community allowing Christians around the world to fellowship with each other in real time chat via webcam, voice, and text, with the Christian Chat app. You can also start or participate in a Bible-based discussion here in the Christian Chat Forums, where members can also share with each other their own videos, pictures, or favorite Christian music.

    If you are a Christian and need encouragement and fellowship, we're here for you! If you are not a Christian but interested in knowing more about Jesus our Lord, you're also welcome! Want to know what the Bible says, and how you can apply it to your life? Join us!

    To make new Christian friends now around the world, click here to join Christian Chat.
No, the error is related to the db. It fails retreving data info.

This is the problem:

$f1=mysql_result($result,$i,"field1");

It can't find field1. What is field1
 
I don't know :p .. like I said, that was a very random attempt cutting and gluing :p

I think the colored code is more likely to fit :p
 
You don't know??? What value do you wan't to retreve from the db then? You tell it to retreve "field1". It tells you it doesn't know what field1 is. :D Computers are nice :D :D
 
:p I'm sleeeeeeeeeepy, my brain barely works when I'm awake

SQl on it's own is OK, when it is in the middle of other codes I loose track of that I'm doing :p
trying to debug the other code now

ed: now at least in prints the headers...

<?php
define("SERVER", "localhost:3306");
define ("BRUKERNAVN", "webuser");
define ("PASSORD", "pass_123");
define ("DATABASENAVN", "temp_inf200");
/* setter KONSTANTER istedenfor variabler*/
?>
<?php
/*
Tilkobling
*/
$db_ref = @mysql_connect( SERVER, BRUKERNAVN, PASSORD );
if( !$db_ref )
die( "Klarte ikke å koble til databaseserveren" );

if( !@mysql_select_db( DATABASENAVN, $db_ref ) )
die( "Klarte ikke å velge angitt database" );

$query = "select fornavn, etternavn from Bruker";
$resultat = @mysql_query( mysql_real_escape_string( $query ) );
if( !$resultat )
die( "Spørring feilet" );
?>
<table id="resultat" class="res_tabell" cellspacing="0">
<tr>
<th>
Fornavn
</th>

<th>
Etternavn
</th>
</tr>
<?php
/*
Gå gjennom resultatsettet rad for rad
*/
while( $row = mysql_fetch_array( $resultat ) )
{
echo "<tr>";
echo "<td>";
echo $row['fornavn'];
echo "</td>";

echo "<td>";
echo $row['etternavn'];
echo "</td>";
echo "</tr>";
}

mysql_close( $db_ref );
?>
</table>
 
Last edited:
This page and the previous made absolutely no sense to me whatsoever.
 
atm it isn't making horrilly much sense to me either, but it's a way of connecting to and getting info from a database (you upload info from it onto a web page or elsewhere)
 
awwww

I want the guy on my group to stop complaining that my sql output looks "very little professional!" -,-
what does he expect?! :p (and he seemingly can't even do what I did, so he sure aint the right person to complain) :p
 
:)
I hope I can make it a bit tidier though... it looks a bit odd with the spaces :p


... I want... dunno why but I want a hug
 
^^

..aw, I was gonna post a song you should play for her, but I don't think it's on youtube