Hello.
#10

Quote:
Originally Posted by iGetty
Посмотреть сообщение
Edit:

I have a new problem.

Well; two.

1) How do I get multiple results from a sql database and then store them into a string?

I have this:

PHP код:
$masql mysql_query("SELECT * FROM Accounts WHERE MasterAccount='$user'");
$marow mysql_fetch_row($masql); 
And

PHP код:
<div align="center"><h5>Current Characters</h5>
                <p><b><?php echo $marow[1]; ?></b></p></div>
IT should show up to 4 characters, not just one.
I understand that you're trying to retrieve all the field values for the 'MasterAccount' $user, and displaying them in php.
If that's the case, try this:
PHP код:
$masql mysql_query("SELECT * FROM Accounts WHERE MasterAccount='$user'");
if(
$masql)
{
while(
$marow mysql_fetch_array($masqlMYSQL_NUM))
{
$field1 $marow[0];
$field2 $marow[1];
// and so on.. to whatever values you need in the table 'Accounts'
}} 
Now, displaying them in php,
PHP код:
<div align="center"><h5>Current Characters</h5>
                <p><b><?php echo "$field1 <br /> $field2 </br> And so on.."?></b></p></div>
Quote:
Originally Posted by iGetty
Посмотреть сообщение
Also;

PHP код:
$sql mysql_query("INSERT INTO Accounts (Username,Password,IP,MasterAccount) VALUES('$charname','$password', '$ip', '$user')") or die (mysql_error()); 
That doesn't store the result of $user into the MasterAccount section on the Table. It just leaves it blank.

Thanks!
Do the remaining values store the result as expected?
Reply


Messages In This Thread
Hello. - by iGetty - 06.06.2012, 01:54
Re: Hello. - by DaRealShazz - 06.06.2012, 02:17
Re: Hello. - by Stereotype - 06.06.2012, 07:31
Re: Hello. - by Cell_ - 06.06.2012, 07:40
Re: Hello. - by kikito - 06.06.2012, 08:44
Re: Hello. - by iGetty - 06.06.2012, 15:20
Re: Hello. - by iLinx - 06.06.2012, 21:56
Re: Hello. - by Mauzen - 06.06.2012, 22:41
Re: Hello. - by iGetty - 06.06.2012, 22:49
Re: Hello. - by donB - 07.06.2012, 02:01

Forum Jump:


Users browsing this thread: 1 Guest(s)