DTP


 
Lively discussions on the graphic arts and publishing — in print or on the web


Go Back   Desktop Publishing Forum > General Discussions > Web Site Building & Maintenance

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 07-14-2005, 12:42 AM   #1
annc
Sysop
 
annc's Avatar
 
Join Date: Oct 2004
Location: Subtropical Queensland, Australia, between the mountains and the Coral Sea
Posts: 4,592
Default Help! PHP/MySQL problem

I'm trying to set up Almond Classifieds, a PHP script that allows people to place classified (eBay style) ads on specially set up web pages. The MySQL database was set up successfully, and today I was working my way through the Readme file setting up the table fields in the config.php file. Because I basically don't know what I'm doing, I've been very careful with this, copying and pasting from the examples in the Readme file and only changing alpha/numeric characters, not any of the punctuation etc.

There are no instructions in the Readme file for creating the MySQL database table, so I opened the index.php in my browser, created an ad, and then submitted it. I got an error saying that the table hadn't been created, and it offered to create it for me. I accepted this offer, but keep getting an error telling me to fix errors in variable $ads_fields but I can't for the life of me see where any errors might be. Here is the variable as I have it in my config.php file:

Code:
#  Set up description of ad fields used in all categories:
$ads_fields= array(
'sale' => array('Sale/Wanted','12','keyword','1:30','select','1','text','<option>SaleWanted'),
'location' => array('Location','12','keyword','30:60','text','1','text'),
'state' => array('State','12','keyword','20:30','text','1','text'),
'breed' => array('Breed','2','keyword','40:50','text','0','text'),
'hname' => array('Name','2','keyword','40:50','text','0','text'),
'sire' => array('Sire','2','keyword','40:50','text','0','text'),
'dam' => array('Dam','2','keyword','40:50','text','0','text'),
'yob' => array('Year of Birth','2','minmax','10:30','text', '0', 'integer'),	
'sex' => array('Gender','12','keyword','1:30','select','1','text','<option>GeldingMareStallion'),
'heihgt' =>  array('Height, hh','2','minmax','10:30','text','0','integer'),	
'colour' => array('Colour','2','keyword','40:50','text','1','text'),
'comp' => array('Competing at','2','nosearch','30:50','text','0','text'),
'work' => array('Working at','2','nosearch','30:50','text','0','text'),
'price' =>  array('Price','12','minmax','10:30','text','1','integer'),
'brief' => array('Brief Description','2','nosearch','40:2:200','textarea','1','text'),
'desc' => array('Description','2','nosearch','50:6:2000','textarea','0','text'),
'contact_name' => array('Contact Name','2','nosearch','40:50', 'text', '1','text'),
'contact_phone' => array('Contact Phone','2','nosearch','20:50', 'text', '0','text'),
'email' => array('Contact e-mail','00','nosearch','20:50', 'text', '1','text'),
'homeurl' => array('Home Page URL', '00','nosearch','40:50', 'text','0','text'),
'passw' => array('Password','00','nosearch','20:50', 'text','1','text'),
'avail' => array('Available/Wanted','12','keyword','1:30','select','1','text','<option>AvailableWanted'),
'psize' =>  array('Size, ha','2','minmax','10:30','text','0','integer')	
);
Here is the relevant section of their config.php file, which they say to use as default settings:

Code:
#  Set up description of ad fields used in all categories:
$ads_fields= array(
'title' => array('Title','1','nosearch','40:50','text','1','text'),
'brief' => array('Brief Description','2','nosearch','40:2:200','textarea','1','text'),
'contact_name' => array('Contact Name','2','nosearch','40:50', 'text', '1','text'),
'contact_phone' => array('Contact Phone','00','nosearch','20:50', 'text', '0','text'),
'email' => array('Contact e-mail','00','nosearch','20:50', 'text', '1','text'),
'homeurl' => array('Home Page URL', '00','nosearch','40:50', 'text','0','text'),
'passw' => array('Edit/delete password','00','nosearch','20:50', 'text','1','text'),
'name' => array('Name','1','nosearch','40:50','text','1','text'),
'city' => array('City','12','keyword','40:50','text','1','text'),
'goal' => array('Goal','12','keyword','1:30','select', '1', 'text',
		'<option>MarriageSexVirtual Romance'),	
'check1' => array('checkbox field','12','keyword','1:30','checkbox','1','text', 
		'<option>checkoption 1checkoption 2checkoption 3' ),
'type' => array('Type','12','keyword','1:30','select', '1','text',
'<option>NeededOffered' ),	
'price' =>  array('Price','12','minmax','10:30','text','0','integer'),
'salary' => array('Salary','12','minmax','10:30','text','0','real'),
'company' => array('Company',"12",'keyword','20:30','text', '0','text'),
'smoker' => array('Smoker','2','nosearch','1:30','select', '1', 'text',
'<option>YesNo' ),
'age' =>  array('Age','12','minmax','10:30','text','1','integer'),
'weihgt' =>  array('Weight,kg','2','minmax','10:30','text','0','integer'),
'height' =>  array('Height,cm','2','minmax','10:30','text','0','integer'),	
'moredetails' => array('More Details','2','nosearch','40:6:2000','textarea','0','text')
);
I'll attach their readme.txt file to this post. Hope someone can see an obvious problem here.
Attached Files
File Type: txt short_readme.txt (15.0 KB, 205 views)

   
__________________
annc is offline   Reply With Quote
 

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP/MySQL Forum dthomsen8 Web Site Building & Maintenance 7 03-18-2007 04:13 AM
PHP5x -> MySQL 5 Stored Procedure Problem LenHewitt Web Site Building & Maintenance 2 12-18-2006 04:07 PM
Weird MySQL problem iamback Web Site Building & Maintenance 37 06-05-2006 10:04 PM
mySQL vs SQL Server LoisWakeman Web Site Building & Maintenance 3 05-25-2006 10:18 PM


All times are GMT -8. The time now is 09:23 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Contents copyright 2004–2019 Desktop Publishing Forum and its members.