MySQL help
I'm working on a PHP driven site and mostly it is going well. I am able to connect, retrieve, and display data from the website.
However, I don't want my username and password to be the one I'm using so I tried to create another user, guest. I logged in using phpMyAdmin, went to the user table and added a user named guest with a password. First thing I noticed was that the password wasn't encrypted as mine was. I realized I probably needed to save the password using the password function and that seemed to encrypt it.
When I tried to use the new username and password in my connection string, though it wouldn't connect.
I noticed from the Home page of phpAdmin there was a place to add a user so I tried that but it told me under my login, I didn't have access. So I went through and granted my login all of the privledges, but it still wouldn't let me add a user.
Please let me know what I need to do.
Secondly, when I view the user table a warning messages comes up that I need to run a script to fix the table structure. How do I run mysql scripts from phpAdmin.
Finally, for now, in the table that I'm retrieving data from I named the fields 30d, 60d, 1y, 2y, etc. When I try to access those using the the following construct:
while ($row2 = mysql_fetch_array($result2)) {
echo '<TR><TD>' . $row2['name'] . '<BR><a href="http://' . $row2['site'] . '">' . $row2['site'] . '</a><td>' . $row2[0] . '<td>' . $row2[1] . '</tr>' ;
}
I had to use the field index instead of the name. How do I reference a field such as 30d in the above code. I tried to do $row2['30d'] but it didn't work. I'm more use to Access then MySQL. I also tried $row2['[30d]'], but no luck.
Thank you.
cd :O)
|