Page 1 of 1
another query question
Posted: Fri Sep 08, 2006 1:45 pm
by Obadiah
say your pulling information from a mySQL database....and the name of the table is foobar....would you do something like this
or would it just be
Posted: Fri Sep 08, 2006 1:48 pm
by Luke
the second one
Posted: Fri Sep 08, 2006 2:05 pm
by Mordred
Code: Select all
$g_sFoobarTable = 'foobar';
//...
function Whateva() {
global $g_sFoobarTable;
$sql = "SELECT * FROM `$g_sFoobarTable`";
}
Posted: Fri Sep 08, 2006 2:15 pm
by Obadiah
ok...i did this and my echo is not working at all
Code: Select all
<?php
session_start();
include("../../asdfr/kdsjfhkasdfk");
$table_name = "customer";
while($newArray = mysql_fetch_array($result)){
$user_name = $newArray['user_name'];
echo "Welcome $user_name to hell";
}
but it does place the username in the browser like its supposed to...but when i just log in regularly it doesnt....why?
Posted: Fri Sep 08, 2006 2:33 pm
by Mordred
Yeah, I can see what went wrong, it's all that code that you haven't posted

That, or you've misspelled "
kdsjfhkasdfk"
Posted: Fri Sep 08, 2006 2:46 pm
by Obadiah
lol...sorry bout that m8 the other code is posted
here
[edited]
if you scroll to the bottom you can see what ive fixed and the problems im having at present
Posted: Fri Sep 08, 2006 2:52 pm
by RobertGonzalez
To answer your original question, read Ninja's reply. As for the snippet of code you posted here in this thread, that tells us nothing. If this is in regards to your other thread, you should post those question in that thread instead of this to prevent possible lock-down of this thread as a double-post.