Welcome! Log In Create A New Profile


mysql error

Posted by TiyaniN 
Announcements Last Post
Announcement : Programming Students at UNISA School of Computing 06/19/2019 02:01PM
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
mysql error
April 22, 2013 04:39PM
I get a duplicate data when I run my web page (oop5_select.php). It display something like:



Also on colour (all six colours):


I have tried to use mysql_assoc, mysql_num and mysql_both but failed,

Example code:

Language: PHP
public function Fetch($model, $colour){ $query=mysql_query("select distinct * from model,colour".$order); $result = array(); while ($record = mysql_fetch_array($query,'mysql_ASSOC')) { $result[] = $record; } return $result; }

I still get duplicate data, what might be the error?
Re: mysql error
April 23, 2013 08:22AM
Hi Tiyani,

Are you sticking to Macs code or are you writing your own?

If you are sticking to Macs code you have the Fetch function a bit wrong, you should leave function as it was and just fill missing bit.
The Fetch function as in Macs code populates the form displaying for the user, thus you first will run the Fetch function for model to populate the model dropdown box then later run the Fetch function again but this time with the coulour info to populate the colour dropdown. In this case your parementers being passed and received are wrong. (you are trying both model & colour in one run)

Please include your code were you are calling the Fetch function (all the instences were you are calling the Fetch function)
That will be helpfull as to see what your code is trying to do with the Fetch function ie what is being passed and received by the paremeteres.
Re: mysql error
April 29, 2013 08:15PM
Hi everyone,

I really need some light on printing out the results in a table using MySQL, because i'm stuck trying to come up with the logic of printing out Yes or No on the rows. can someone enlighten me please.

Re: mysql error
April 30, 2013 08:05AM
I think this was touched upon in another thread.
Sorry, only registered users may post in this forum.

Click here to login