Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
php to display records does not always display once on a live server!
Old 01-29-2008, 02:04 PM php to display records does not always display once on a live server!
Average Talker

Posts: 27
Trades: 0
hi all,

i have just finished the site www.picturethisframing.co.uk selling online fine arts and have also built a CMS for the owners to update products as needed.

In the CMS, the owners can add, edit or delete particular artists (the categories) and also add, edit or delete each particular artwork which is then assigned within the particular artists. the artists table consists of an artist id, name and a description and the products consist of an id, name, and attributes such as size and price. when entering a product they can also upload an image for it which is also stored within the database as a text field of the file name.

however, on testing locally on my xmapp setup it all works perfectly. however now it is on a live server, the following is happening:

It will add an artist and insert the details into the database fine with no problems. It will also then display the artist on the list of artists page no problems (each artist name links to a next page that display all products by that chosen artist) but when clicked, the url parameter passes the artist id but does not display even the artist name from the recordset that is decided by the url parameter value. Even if the artist has no products within it (which is the case here) it should display a no products available message but is not doing in this case. It seems like an url parameter has been sent but now used.

Secondly, when adding products within the CMS on the live site, it will happily do all the image functions and upload it to the correct places but this time it does not even insert the product details into the database for some unknown reason.

When testing on my local xampp setup, everything works fine until it is uploaded onto my 1and1 linux server.

Any ideas anyone?

I can send you parts of my code if need be to help out!

Gav
gavrd1 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-29-2008, 02:40 PM Re: php to display records does not always display once on a live server!
Extreme Talker

Posts: 182
Trades: 0
Did you solve your problem? I looked at your website, but I could not figure out what you were talking about.

As for your issue with the data not getting inserted, what kind of error logging are you doing? Are any errors being thrown?

Maybe try adding an 'or die ( mysql_error ( ) );' to your queries for testing purposes.

If you could try to clarify your problems a bit more, I will be happy to try to help!
bhgchris is offline
Reply With Quote
View Public Profile
 
Old 01-29-2008, 02:53 PM Re: php to display records does not always display once on a live server!
Average Talker

Posts: 27
Trades: 0
Hi Chris,

An example of the site is if you look in the online sales section and select B H Brody from the artists. It will then take you to a new page that should list all the products by B H Brody. B H Brody was added using the CMS when it was live. In this case there are no products by B H Brody so it should output a message saying "no products available" but it does not in this case, nor does it display the artists name as it should. Whereas if you chose someone like A J Callan (who was inserted not using the cms but still fits the right criteria for the database, you can view his products perfectly.

I will put some error reporting in for testing and give it a go and let you know what I come up with.

Gav
gavrd1 is offline
Reply With Quote
View Public Profile
 
Old 01-29-2008, 03:15 PM Re: php to display records does not always display once on a live server!
Extreme Talker

Posts: 182
Trades: 0
A J Callan appears to have products associated with him, whereas B H Brody does not. I can only assume the problem lies in your PHP logic.

If your MySQL query is searching for rows where the artist ID is == to $_GET['fac_id'] AND has products associated with it, the query will come up empty ( if nothing matches that criteria ).

You will need to check the number of results that are returned.

if ( no results )
{
echo "no pieces available from this artist.";
}
else
{
echo "there are pieces available from this artist.";
}

Is this what you are doing? Perhaps a snippet of your code would help.

ps: I should also mention that the way you are simply inserting whatever is passed with fac_id is not a good idea. You should check to make sure $_GET['fac_id'] is a valid value before inserting it into the query.
bhgchris is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to php to display records does not always display once on a live server!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.19519 seconds with 12 queries