WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here!

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-05-2008, 05:37 PM
chrisJumbo chrisJumbo is offline
WebProWorld Pro
 

Join Date: Oct 2005
Location: California
Posts: 256
chrisJumbo RepRank 1
Default 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)
Reply With Quote
  #2 (permalink)  
Old 04-06-2008, 04:58 AM
speed speed is offline
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Cornwall, UK
Posts: 806
speed RepRank 1
Default Re: MySQL help

See MySQL :: MySQL 5.0 Reference Manual :: 5.5.2 Adding New User Accounts to MySQL for adding a new user, generally though it's easier to add the user via cPanel or whatever control panel you are using.

Without the exact error message I'm having to guess a but, but the script it is asking you to run can't be run via phpmyadmin, it must rather be run from the command line.

Finally try using mysql_fetch_assoc rather than mysql_fetch_array.
__________________
TOLRA Micro Systems Limited US & UK Web Hosting with Continuous Data Protection
Web Directory : Web Directory Script
Reply With Quote
  #3 (permalink)  
Old 04-07-2008, 07:10 PM
chrisJumbo chrisJumbo is offline
WebProWorld Pro
 

Join Date: Oct 2005
Location: California
Posts: 256
chrisJumbo RepRank 1
Default Re: MySQL help

Thank you. I will check out your suggestions.

cd :O)
Reply With Quote
  #4 (permalink)  
Old 04-11-2008, 06:18 AM
site-aanmelden site-aanmelden is offline
WebProWorld New Member
 

Join Date: Apr 2008
Posts: 6
site-aanmelden RepRank 0
Default Re: MySQL help

exact error message will help us to give a proff advice
Reply With Quote
  #5 (permalink)  
Old 04-11-2008, 06:50 AM
kgun's Avatar
kgun kgun is offline
WebProWorld 1,000+ Club
 

Join Date: May 2005
Location: Norway
Posts: 4,108
kgun RepRank 2kgun RepRank 2
Default Re: MySQL help

Do you use, PDO, the PHP Data Objects extension that ships with PHP 5.1?
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP/MySQL CMS Sergio Simarro eCommerce Discussion Forum 7 11-30-2007 02:41 PM
Which one? PHP or MySQL dak888 Database Discussion Forum 17 11-29-2007 02:26 AM
CSV to mySQL richkoi Database Discussion Forum 14 09-14-2006 03:42 PM
mySQL 5 vs mySQL 4 chingumbe IT Discussion Forum 6 05-24-2006 06:54 PM
NEW TO PHP mySQL richkoi Database Discussion Forum 0 06-05-2005 04:27 PM


Search Engine Friendly URLs by vBSEO 3.0.0