Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.

Thread Tools Display Modes
Share |
Old 08-11-2018, 06:12 AM
ScriptMan's Avatar
ScriptMan ScriptMan is offline
Super Moderator
Join Date: 02-10-07
Location: Central Kentucky
Posts: 14,038
iTrader: 4 / 100%
Best practice row[ x ] to variable

There is nothing like being timely and my time is about up to convert mysql queries to mysqli queries.

The second one took no where near as long as the first one.

The third one caused me some problems and in the process of getting that one working I discovered that this code
PHP Code:
 echo $row[0],$row[1],$row[2] . "<br />"
would work when displaying a query result that only contained data from 3 columns while using the old mysql format
PHP Code:
echo $row['id'],$row['title'],$row['rate'] . "<br />"
throws an Undefined index: error.

Converting the $row[x] to a named variable as the rows are processed also works and may be the more simple approach as I format the data later in the script. I may answer my own question.

My mind says that conversion makes it easier to follow a year from now but the $row[x] method sure is faster.

What say you? Is there a proper practice?
Reply With Quote



Go Back   Webmaster Forum > Web Development > Coding Forum


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
changing domain name - best practice to not lose SERP imadam SEO Forum 3 07-05-2018 03:37 AM
Does Event listings helpful in SEO practice? pavani25 SEO Forum 19 03-20-2018 04:42 AM
Best SEO Practice for Online Jewelry Store Naksh SEO Forum 1 09-11-2017 06:16 AM

V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory

All times are GMT -7. The time now is 11:52 PM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC