syntax problem, full code provided

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

ok, ive read them and im still none the wiser, arrays pretty much baffle me :?
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

heres a guide to PHP Arrays, they aren't that tricky :) Honest

http://www.free2code.net/tutorials/prog ... /array.php

Mark
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

ok i dont mean to spam but

unless your a genius you prolly wont know this, and it might just be me nitpicking (prolly is)

why do you have to create an array just to retrieve one piece of data, sounds a bit odd to me!?

but then again im a newbie with limited knowledge, oh godly one :oops:
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

as always, there is more than one way to do it. The code i gave you is just a snippet i had to hand. You can perform the query to return just that one piece of information, but i don't use it that often and would need to find the correct syntax.
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

ok, well thanks for your help

im gonna have to learn arrays i suppose :cry:
have a book about them, but doesnt have any examples taht are remotely of any use whatsoever :(
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

You don't have to create an array for one piece of data, I linked to [php_man]mysql_result[/php_man]() for that reason.

Mac
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

u did!?!?!?!?!

so that code now works
<-- still needs to learn array though :cry: , will try to put it off as long as possible

thank you man, your a life saver
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

malcolmboston wrote:thank you man, your a life saver
think you mean woman :lol:

Mark
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

woman?

very knowledgable woman
sorry assumed us 'geeks' were all men :lol:
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

my bad

i wasnt calling a session_start(); at the beginning of the page
also i was defining the session already at the beginning thats why various things didnt work, everything works not and ive completed the site after doing some other PHP related things to it, thanks

sorry for that
just shows, if your looking for a complex answer, then its normally something simple and stupid
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

malcolmboston wrote: just shows, if your looking for a complex answer, then its normally something simple and stupid
And that, my friend, is something that you will encounter again and again and again and...
Point being, you are not aloneI found this quote amusing as I said that to myself today. ;)
Post Reply