NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Good project to better my php skills?

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 07-04-2006, 07:13 PM THREAD STARTER               #1 (permalink)
Senior Member
 
killaklown's Avatar
Join Date: Oct 2003
Posts: 3,472
killaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to behold
 



Good project to better my php skills?


What would be a good project to better my php skills? Im new at php and finish coding a simple script at: http://www.netsnatch.com/script (which checks to see if the entered domain contains a valid license)

I dont think im ready with mysql, as most of the mysql information in the above script was copied from other scripts i bought.
killaklown is offline  
Old 07-04-2006, 08:40 PM   #2 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
Join Date: Feb 2006
Posts: 2,796
Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future
 


Autism Autism Autism Autism Autism Autism Autism
http://www.netsnatch.com/script/

Doesn't work.

MySQL basically has 3 commands (insert, select, update; the others aren't used as much) that you need to know. It isn't hard at all.
Dan is offline  
Old 07-04-2006, 08:46 PM THREAD STARTER               #3 (permalink)
Senior Member
 
killaklown's Avatar
Join Date: Oct 2003
Posts: 3,472
killaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to behold
 



im working on making the script do more right now so it may give errors at times.

The things im not understanding right now about mysql is
mysql_query
mysql_fletch_array
etc.


Edit:

How can i get the number in a row in the database?

Code:
<?
$query = "SELECT downloads FROM counter WHERE id='1'";
$result = mysql_query($query);
$myrecord = mysql_fetch_row($result);

echo''.$myrecord.'';
?>
I have that, i want it to show the number in the 'downloads' column that has an id of 1, but all it does it show 'Array'.
Last edited by killaklown; 07-04-2006 at 08:52 PM.
killaklown is offline  
Old 07-04-2006, 09:00 PM   #4 (permalink)
NamePros Regular
Join Date: Dec 2005
Posts: 210
wackyjoe is on a distinguished road
 



i would use mysql_fetch_array().
wackyjoe is offline  
Old 07-04-2006, 09:31 PM   #5 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
Join Date: Feb 2006
Posts: 2,796
Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future
 


Autism Autism Autism Autism Autism Autism Autism
Use mysql_fetch_array instead of mysql_fetch_row.

I don't know why you are doing echo '', since the '' doesn't do anything.

$myrecord is an array with the row you got from the database. If you do mysql_fetch_array instead of mysql_fetch_row, you can do $myrecord['something'], where something is the name of the column in the database.
Dan is offline  
Old 07-05-2006, 10:50 AM THREAD STARTER               #6 (permalink)
Senior Member
 
killaklown's Avatar
Join Date: Oct 2003
Posts: 3,472
killaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to behold
 



i tried using mysql_fetch_array() but it still showed array.
killaklown is offline  
Old 07-05-2006, 11:31 AM   #7 (permalink)
NamePros Regular
 
Tree's Avatar
Join Date: Feb 2006
Location: Atlanta, GA, USA
Posts: 335
Tree will become famous soon enoughTree will become famous soon enough
 



You can't echo an array. Try print_r($myrecord) with mysql_fetch_array
Tree is offline  
Old 07-05-2006, 12:57 PM   #8 (permalink)
NamePros Regular
 
Flubber's Avatar
Join Date: Jun 2005
Location: UK
Posts: 688
Flubber is a splendid one to beholdFlubber is a splendid one to beholdFlubber is a splendid one to beholdFlubber is a splendid one to beholdFlubber is a splendid one to beholdFlubber is a splendid one to beholdFlubber is a splendid one to beholdFlubber is a splendid one to behold
 


Baby Health
PHP Code:
<?
$query 
"SELECT downloads FROM counter WHERE id='1'";
????: NamePros.com http://www.namepros.com/programming/213541-good-project-better-my-php-skills.html
$result mysql_query($query);
$myrecord mysql_fetch_row($result);

echo 
$myrecord['0'];
?>
Should work.

Flubb.
Flubber is offline  
Old 07-05-2006, 05:59 PM THREAD STARTER               #9 (permalink)
Senior Member
 
killaklown's Avatar
Join Date: Oct 2003
Posts: 3,472
killaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to behold
 



thanks flubber, works.
killaklown is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 08:28 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger