fetching data from a row

Problems with the Windows version of XAMPP, questions, comments, and anything related.

fetching data from a row

Postby gsdoby » 10. November 2011 21:05

listed below is code I am using to extract some data from a database.
while($row = mysqli_fetch_assoc($result))
{en
extract($row);
echo "<tr>\n
<td>$department</td>\n
<td>$1990</td>\n

I am using 1990 as a field name defined in the structure as a year. When I run the code the data shows the field name (1990) insted of the appropriate data in the field. I am new to coding and am having trouble understanding the problem Is using a number for the field name an issue. any help will be appreciated
gsdoby
 
Posts: 19
Joined: 08. August 2011 18:13

Re: fetching data from a row

Postby Altrea » 10. November 2011 21:39

Please add your operating system and used XAMPP version in your Profile data. This will help us to give you the support relating to your correct environment.

And next time, please use the Board BBTags "Code" if you post code.

Let me quote something for you:

Naming Rules for Variables

A variable name must start with a letter or an underscore "_"
A variable name can only contain alpha-numeric characters and underscores (a-z, A-Z, 0-9, and _ )
A variable name should not contain spaces. If a variable name is more than one word, it should be separated with an underscore ($my_string), or with capitalization ($myString)

http://www.w3schools.com/php/php_variables.asp
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 116 guests