Code: Select all
SELECT title FROM form WHERE default IS TRUECode: Select all
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\form\includes\DbConnector.php on line 53Moderator: General Moderators
Code: Select all
SELECT title FROM form WHERE default IS TRUECode: Select all
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\form\includes\DbConnector.php on line 53Code: Select all
SELECT * FROM form WHERE defaultform IS TRUECode: Select all
Unknown column 'defaultform' in 'where clause'Code: Select all
_______________________________________________________________________________________________________________
|id | defaultform | frequency | title | question1 |
|2 | 1 | 0 | MMNP Questionnaire | Did you carry your smartphone with you today to sc...|Code: Select all
SELECT * FROM `form` WHERE `defaultform` = 1;Code: Select all
SHOW CREATE TABLE titleThat gives me a Syntax error. But,Everah wrote:Try changing the where clause to 'default = 1', like this...
Code: Select all
SELECT * FROM `form` WHERE `defaultform` = 1;
Code: Select all
SELECT * FROM form WHERE 'defaultform' = 1 I'm not sure what you are looking for when you say this. If I use that statement I get an error telling me that the table 'title' does not exist.volka wrote:and please post the (textual) result ofCode: Select all
SHOW CREATE TABLE title
Code: Select all
SHOW CREATE TABLE `form`;Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
[color=green][b]Everah[/b] | Edited the original post to replace \n with actual new lines.[/color]
Here are the results:
[syntax="sql"]CREATE TABLE `form` (
`id` int(11) NOT NULL auto_increment,
` defaultform` tinyint(1) NOT NULL,
`frequency` tinyint(4) NOT NULL,
`title` text NOT NULL,
`question1` text NOT NULL,
`q1type` tinyint(4) NOT NULL,
`q1ans1` text NOT NULL,
`q1ans2` text NOT NULL,
`q1ans3` text NOT NULL,
`q1ans4` text NOT NULL,
`q1ans5` text NOT NULL,
`q1ans6` text NOT NULL,
`q1ans7` text NOT NULL,
`q1ans8` text NOT NULL,
`question2` text NOT NULL,
`q2type` tinyint(4) NOT NULL,
`q2ans1` text NOT NULL,
`q2ans2` text NOT NULL,
`q2ans3` text NOT NULL,
`q2ans4` text NOT NULL,
`q2ans5` text NOT NULL,
`q2ans6` text NOT NULL,
`q2ans7` text NOT NULL,
`q2ans8` text NOT NULL,
`question3` text NOT NULL,
`q3type` tinyint(4) NOT NULL,
`q3ans1` text NOT NULL,
`q3ans2` text NOT NULL,
`q3ans3` text NOT NULL,
`q3ans4` text NOT NULL,
`q3ans5` text NOT NULL,
`q3ans6` text NOT NULL,
`q3ans7` text NOT NULL,
`q3ans8` text NOT NULL,
`question4` text NOT NULL,
`q4type` tinyint(4) NOT NULL,
`q4ans1` text NOT NULL,
`q4ans2` text NOT NULL,
`q4ans3` text NOT NULL,
`q4ans4` text NOT NULL,
`q4ans5` text NOT NULL,
`q4ans6` text NOT NULL,
`q4ans7` text NOT NULL,
`q4ans8` text NOT NULL,
`question5` text NOT NULL,
`q5type` tinyint(4) NOT NULL,
`q5ans1` text NOT NULL,
`q5ans2` text NOT NULL,
`q5ans3` text NOT NULL,
`q5ans4` text NOT NULL,
`q5ans5` text NOT NULL,
`q5ans6` text NOT NULL,
`q5ans7` text NOT NULL,
`q5ans8` text NOT NULL,
`question6` text NOT NULL,
`q6type` tinyint(4) NOT NULL,
`q6ans1` text NOT NULL,
`q6ans2` text NOT NULL,
`q6ans3` text NOT NULL,
`q6ans4` text NOT NULL,
`q6ans5` text NOT NULL,
`q6ans6` text NOT NULL,
`q6ans7` text NOT NULL,
`q6ans8` text NOT NULL,
`question7` text NOT NULL,
`q7type` tinyint(4) NOT NULL,
`q7ans1` text NOT NULL,
`q7ans2` text NOT NULL,
`q7ans3` text NOT NULL,
`q7ans4` text NOT NULL,
`q7ans5` text NOT NULL,
`q7ans6` text NOT NULL,
`q7ans7` text NOT NULL,
`q7ans8` text NOT NULL,
`question8` text NOT NULL,
`q8type` tinyint(4) NOT NULL,
`q8ans1` text NOT NULL,
`q8ans2` text NOT NULL,
`q8ans3` text NOT NULL,
`q8ans4` text NOT NULL,
`q8ans5` text NOT NULL,
`q8ans6` text NOT NULL,
`q8ans7` text NOT NULL,
`q8ans8` text NOT NULL,
`question9` text NOT NULL,
`q9type` tinyint(4) NOT NULL,
`q9ans1` text NOT NULL,
`q9ans2` text NOT NULL,
`q9ans3` text NOT NULL,
`q9ans4` text NOT NULL,
`q9ans5` text NOT NULL,
`q9ans6` text NOT NULL,
`q9ans7` text NOT NULL,
`q9ans8` text NOT NULL,
`question10` text NOT NULL,
`q10type` tinyint(4) NOT NULL,
`q10ans1` text NOT NULL,
`q10ans2` text NOT NULL,
`q10ans3` text NOT NULL,
`q10ans4` text NOT NULL,
`q10ans5` text NOT NULL,
`q10ans6` text NOT NULL,
`q10ans7` text NOT NULL,
`q10ans8` text NOT NULL,
`question11` text NOT NULL,
`q11type` tinyint(4) NOT NULL,
`q11ans1` text NOT NULL,
`q11ans2` text NOT NULL,
`q11ans3` text NOT NULL,
`q11ans4` text NOT NULL,
`q11ans5` text NOT NULL,
`q11ans6` text NOT NULL,
`q11ans7` text NOT NULL,
`q11ans8` text NOT NULL,
`question12` text NOT NULL,
`q12type` tinyint(4) NOT NULL,
`q12ans1` text NOT NULL,
`q12ans2` text NOT NULL,
`q12ans3` text NOT NULL,
`q12ans4` text NOT NULL,
`q12ans5` text NOT NULL,
`q12ans6` text NOT NULL,
`q12ans7` text NOT NULL,
`q12ans8` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]Code: Select all
` defaultform`