You are here: Re: why does this code not work...pulling my hair out... « All PHP « IT news, forums, messages
Re: why does this code not work...pulling my hair out...

Posted by Tony on 06/24/05 19:21

toedipper wrote:
>>>
>>> It inserts ok but the value for the last field userid is always
>>> written back as blank. The userid should be filled from the
>>> session id $_SESSION[MM_Username]
>>>
>>> Any ideas? On the same page that this is on I can echo
>>> $_SESSION[MM_Username] and that works ok.

This problem looks quite familiar - I think we just discussed it last week.
I'm assuming with someone else :)

There are a number of solutions, but here's an easy one:

$MM_Username = $_SESSION[MM_Username];
$insertSQL = sprintf("INSERT INTO software (title, shortdesc,
`desc`,version, minreqs, wareid, catid, hpage, dllink, dlsize,
triallength,price, keywords, liveyn, submitdate, submittime, userid) VALUES
(%s, %s,%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, 'N',
current_date(),current_time(), '$MM_Username')", <.. code continued as
originally written..>

--
Tony Garcia
Web Right! Development
tony.NO@webrightdevelopment.SPAM.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация