Corey Maddox Posted December 8, 2007 Share Posted December 8, 2007 Okay I have a login script and it writes 4 things into a mySQL database Username - name Password - pass Level - level ID - id mainly I have this script that calls for the lines and displays them how they need to be. <? $host = "sql06.freemysql.net"; $user = "coreyma"; $pass = "japanese"; $dbname = "csmusers"; $connection = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."<BR>"); mysql_select_db($dbname); $sql = 'SELECT * FROM `data` LIMIT 0, 30 '; $query = mysql_query($sql); while ($row = mysql_fetch_array($query)) { echo "$"; echo "cfgLogin[",$row['id'],"] = '",$row['name'],"';<br>"; echo "$"; echo "cfgPassword[",$row['id'],"] = '",$row['pass'],"';<br>"; echo "$"; echo "cfgUserLevel[",$row['id'],"] = '",$row['level'],"';<br>"; echo "$"; echo "cfgUserID[",$row['id'],"] = '",$row['id'],"';<br><br>"; } ?> This the rows and style needs to be actually inserted into the php file, not echoed and displayed... I dunno how to do that, any help would be great. Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 8, 2007 Share Posted December 8, 2007 do something like this: <?php while ($row = mysql_fetch_array($query)) { echo "<span style=\"color:red\">"; // add your css styles to this span // echo php variable here echo "</span>"; } ?> you could also give your span an id or class and style the span in an external css file. Quote Link to comment Share on other sites More sharing options...
Corey Maddox Posted December 8, 2007 Author Share Posted December 8, 2007 No... right now the text is being echoed as $cfgLogin[1] = 'test'; $cfgPassword[1] = 'test'; $cfgUserLevel[1] = ''; $cfgUserID[1] = '1'; But it is echoing as displayed text... I need it to somehow just be on the page and not echoed... liek part of the actual script... Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 8, 2007 Share Posted December 8, 2007 place each of your field values in a variable like: $username = $row["username"]; Quote Link to comment Share on other sites More sharing options...
zimmer Posted December 8, 2007 Share Posted December 8, 2007 you also might want to change your password, now that we know it. Quote Link to comment Share on other sites More sharing options...
Corey Maddox Posted December 10, 2007 Author Share Posted December 10, 2007 Will do. Especially since some dumbass hacked my gmail and youtube , but thankfully I recovere my accounts. I also got the script to be fully functional now Thanks you guys! -Corey Maddox Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.