WHAT DO YOU WANT?

  • 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.
W

wwjd_kilden

Guest
hehe :D

I'm afraid I can't help, I know very little about Germany :p
 
I

ilovehillsong

Guest
lol, don't worry, I am armed with a textbook and the email address of my uncle!! I shall not fail!!:D
 
W

wwjd_kilden

Guest
good :D

Aaaaaaaaaaaaaaaaaaaaaaaaakselllll! I am having SQlL - HTML - PHPproblems! (though I don't know how much of the problem is what) :p
 
I

ilovehillsong

Guest
woah, random capital letter spillage!! ALERT!!ALERT!!
 
W

wwjd_kilden

Guest
yup, dangerous things, especially when combined...
 
B

Belgian_Pilot

Guest
good :D

Aaaaaaaaaaaaaaaaaaaaaaaaakselllll! I am having SQlL - HTML - PHPproblems! (though I don't know how much of the problem is what) :p
Yeeeeeeeeeeeeeeeees????? Can't miss me, can you? :p

No PHP.

Whats the SQL-HTML problem?
 
W

wwjd_kilden

Guest
I am trying (rather randomly, and by copy paste atm) to format my sql output

that is, trying to make it tidy, or put it into a visible table... anything to make it easy to read... but I don't know nough about tables, and definitly not enough about php combined with html

so atm, this is how it looks: :p
http://studit.hinesna.no/~astridb/PHP/database.php
 
B

Belgian_Pilot

Guest
This is what I get:

De XML-pagina kan niet worden weergegeven

Kan XML-invoer niet lezen met opmaakmodel . Herstel de fout en klik vervolgens op de knop Vernieuwen of probeer het later opnieuw. Ongeldig op het hoogste niveau van het document. Fout bij het verwerken van bron http://studit.hinesna.no/~astridb/PHP/data...
Ola Nordmann<br/>Kari Johnson<br/>Arne Nordmann<br/><br/><?xml version="1.0" encoding="utf-8" ?&g...
 
W

wwjd_kilden

Guest
hmmmm.... the names bit is the output of my fist query, maybe the school servers block out other countries?

HDD can you see this one?
 
B

Belgian_Pilot

Guest
Yes, that works :)

Ok now what should I do?
 
W

wwjd_kilden

Guest
I was just testing to see if the site was closed or something .........hmmm, ok, nm the link


and I have no idea why, but as I caopy pasted, for all I know I could be lacking a chunk of code:'

first I connect to the database via PHP, then I try this:


$query="SELECT * FROM Scene";
$result=mysql_query($query);

$num=mysql_numrows($result);

mysql_close();
?>
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<th><font face="Arial, Helvetica, sans-serif">Value1</font></th>
<th><font face="Arial, Helvetica, sans-serif">Value2</font></th>
<th><font face="Arial, Helvetica, sans-serif">Value3</font></th>
<th><font face="Arial, Helvetica, sans-serif">Value4</font></th>
<th><font face="Arial, Helvetica, sans-serif">Value5</font></th>
</tr>

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

$f1=mysql_result($result,$i,"field1");
$f2=mysql_result($result,$i,"field2");
$f3=mysql_result($result,$i,"field3");
$f4=mysql_result($result,$i,"field4");
$f5=mysql_result($result,$i,"field5");
?>

<tr>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f2; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f3; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f4; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f5; ?></font></td>
</tr>

<?php
$i++;
}
?>
</body>
</html>


which prints the error messages

Warning: mysql_result() [function.mysql-result]: field1 not found in MySQL result index 6 in /home/inf09/astridb/public_html/PHP/database.php on line 102

Warning: mysql_result() [function.mysql-result]: field2 not found in MySQL result index 6 in /home/inf09/astridb/public_html/PHP/database.php on line 103
...
 
B

Belgian_Pilot

Guest
Can you post the connection string?
 
W

wwjd_kilden

Guest
/*this?*/

<?php
define("SERVER", "localhost:3306");
define ("BRUKERNAVN", "webuser");
define ("PASSORD", "pass_123");
define ("DATABASENAVN", "temp_inf200");
/* setter KONSTANTER istedenfor variabler*/

$db_handle=@mysql_connect(SERVER, BRUKERNAVN, PASSORD);

if (! $db_handle)
die('Unable to connect ' );

$returverdi=@mysql_select_db(DATABASENAVN);
if (! $returverdi)
{
@mysql_close($db_handle);
die ('unable to select db');
}

/* ready for queries */

$query="select fornavn, etternavn from Bruker";
$resultat=@mysql_query(mysql_real_escape_string($query)); /* hold query result*/

while($rad=@mysql_fetch_array($resultat))
{
echo $rad['fornavn'] . " " . $rad['etternavn'] . "<br/>"; /* print result, but not much formatting here... */
}

@mysql_free_result($resultat); /*releases memory */

@mysql_close($db_handle);

?>
 
B

Belgian_Pilot

Guest
Yes. This is the db connections string

$db_handle=@mysql_connect(SERVER, BRUKERNAVN, PASSORD);

I suppose the table Scene you try to access is in the db BRUKERSNAVN?
 
W

wwjd_kilden

Guest
no, it i in the database temp_inf200

define ("BRUKERNAVN", "webuser"); /*username*/

define ("DATABASENAVN", "temp_inf200"); /*databasename*/
 
W

wwjd_kilden

Guest
hmm... might have found something useful, but my brain is crashing, so I can see it makes sense without really understanding what it does for the moment :p

?>
<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>";
}
 
B

Belgian_Pilot

Guest
Can you see what line that creates the error? It says line 102
 
W

wwjd_kilden

Guest
that was just a excerpt

all the lines like this one
<th><font face="Arial, Helvetica, sans-serif">Value3</font></th>
seems to somehow fail, I'm trying to make the other code work now, it looked tidier :p still have ni idea what I'm really doing though