Need help as to why my php code quit working

Hi,
I am don’t know much about php and this code was written by someone else. It is not showing the sponsorship or amount on the page. Can anyone look at this for me and make corrections or suggestions?

Thank you…Diana

[php]<?php
$user =& JFactory::getUser();
$userid = $userid;
$query = mysql_query(“SELECT * FROM table_hosts WHERE userId = ‘$userid’”);
$row = mysql_fetch_array($query, MYSQL_ASSOC);
$sponsorship = $row[‘sponsorship’];
if ($sponsorship == ‘Table Host - $500’) {
$amount = 500;
}
else if ($sponsorship == ‘Guardian Angel - $1000’) {
$amount = 1000;
}
else if ($sponsorship == ‘Archangel - $2500’) {
$amount = 2500;
}
else if ($sponsorship == ‘Cherubim - $5000’) {
$amount = 5000;
}
else if ($sponsorship == ‘Seraphim - $10,000’) {
$amount = 10000;
}
print "

You have selected the following support level: $sponsorship

"; print "

Note: * = required fields

Billing Information:

*Full Name
*Email
Phone
*Address
*City
*State
*Zip

Payment Information:

Amount $$amount
*Card Type Visa MasterCard American Express Discover
*Card Number
*Expires on Mo Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Yr 2011 2012 2013 2014 2015

Additional Information/Comments



Gifts to StandUpGirl Foundation are tax deductible as charitable contributions. It is IRS certified 501(c)(3).

";?>[/php]

Where do you specify $userid? This doesn’t make sense:

[php]$userid = $userid; [/php]

the userid is from community builder. this is joomla based site

Are you saying this code worked before? Did you change anything (upgrade PHP for example)?

Not that I am aware of…my host is SingleHop.

Sponsor our Newsletter | Privacy Policy | Terms of Service