Click here to Skip to main content
15,887,596 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
AnswerRe: Pass datepicker value to PHP & MySQL Pin
Thomas Daniels8-Feb-15 2:59
mentorThomas Daniels8-Feb-15 2:59 
QuestionMake this Hashing in PHP Pin
Jassim Rahma28-Jan-15 21:05
Jassim Rahma28-Jan-15 21:05 
AnswerRe: Make this Hashing in PHP Pin
Richard MacCutchan28-Jan-15 21:24
mveRichard MacCutchan28-Jan-15 21:24 
Question$_COOKIE[session_name()] vs session_id() which one holds good? Pin
Jayapal Chandran28-Jan-15 10:11
Jayapal Chandran28-Jan-15 10:11 
QuestionApache2.sin do not peer *.pl domain Pin
pixcraft14-Jan-15 2:33
pixcraft14-Jan-15 2:33 
QuestionFlash drive on Linux Pin
ForNow13-Dec-14 14:28
ForNow13-Dec-14 14:28 
AnswerRe: Flash drive on Linux Pin
Michael Martin9-Jan-15 20:22
professionalMichael Martin9-Jan-15 20:22 
Questionselectbox sql problems Pin
ceewhitehead7-Nov-14 0:39
ceewhitehead7-Nov-14 0:39 
Hi all,
I have got 4 drop down selection boxes.The idea is to be able to select an item from each selection box,get them strung together in sql string and get the result of the query printedConfused | :confused:
The problem is I keep getting the following message:

Parse error: syntax error, unexpected '$rs' (T_VARIABLE) in C:\xampp\htdocs\dreamincode.php on line 60

I know the code is not too sophisticated but it's part of a little project I started earlier this year and then got distracted and just managed to get back to it now. Smile | :) Smile | :)
Here is the code in full.Any suggestions greatly appreciated.

PHP
<pre lang="xml"><!DOCTYPE HTML>
02    <html>
03    <body>
04
05
06    <select name = "author">
07    <option value="kendavies">ken davies</option>
08     <option value="arthursmith">arthur smith</option>
09    <option value="gillrafferty">gill rafferty</option>
10    <option value="mollybrown">molly brown</option>
11    <option value="gilbert riley">gilbert riley</option>
12    <option value="colinwilson">colin wilson</option>
13      <option value="jamesgreen">james green</option>
14     <option value="arnoldlaing">arnold laing</option>
15    <option value="cathyellis">cathy ellis</option>
16    <option value="carolreed">carol reed</option>
17
18    </select>
19
20    <select name = "publisher">
21    <option value="yonkers">yonkers</option>
22     <option value="blueparrot">blue parrot</option>
23    <option value="zoot">zoot</option>
24
25    </select>
26      <select name = "published">
27    <option value="2003">2003</option>
28     <option value="2004">2004</option>
29    <option value="2005">2005</option>
30    <option value="2006">2006</option>
31    <option value="2007">2007</option>
32    <option value="2008">2008</option>
33
34    </select>
35
36     <select name = "genre">
37    <option value="adventure">adventure</option>
38     <option value="thriller">thriller</option>
39    <option value="crime">crime</option>
40    <option value="biography">biography</option>
41    <option value="romance">romance</option>
42
43    </select>
44    $aa = "author"
45    $bb = "publisher"
46    $cc = "yearpublished"
47    $dd = "genre"
48        </body>
49  </html>
50  <?php
51
52    $aa = "author";
53    $bb = "publisher";
54    $cc = "yearpublished";
55    $dd = "genre";
56   mysql_connect ("localhost","root","") or die(mysql_error());
57  mysql_select_db ("authors") or die(mysql_error());
58
59  $strSQL = SELECT * FROM `books`WHERE author = '".$aa."' AND publisher = '".$bb."' AND yearpublished = '".$cc."' AND genre ='".$dd."'" ";
60   $rs = mysql_query($strSQL);
61
62
63
64  while($row = mysql_fetch_array($rs) ) {
65
66  print $row ['ID']."<br/>";
67  print $row ['author']."<br/>";
68  print $row ['booktitle']."<br/>";
69  print $row ['publisher']."<br/>";
70  print $row ['yearpublished']."<br/>";
71  print $row ['genre']."<br/>";
72  print $row ['copiessold']."<br/>";
73
74
75     }
76    mysql_close();
77  ?>
78  </body>
79  </html>





kind regards
col
AnswerRe: selectbox sql problems Pin
Richard MacCutchan7-Nov-14 0:59
mveRichard MacCutchan7-Nov-14 0:59 
GeneralRe: selectbox sql problems Pin
ceewhitehead7-Nov-14 2:29
ceewhitehead7-Nov-14 2:29 
GeneralRe: selectbox sql problems Pin
Richard MacCutchan7-Nov-14 2:40
mveRichard MacCutchan7-Nov-14 2:40 
Questionzend & php code Pin
vaguemind2-Nov-14 21:02
vaguemind2-Nov-14 21:02 
Questionlaunch a web app using python Pin
Member 94937201-Nov-14 22:02
Member 94937201-Nov-14 22:02 
AnswerRe: launch a web app using python Pin
Richard MacCutchan1-Nov-14 22:09
mveRichard MacCutchan1-Nov-14 22:09 
QuestionCode Samples Pin
Brandi Boseman29-Oct-14 8:00
Brandi Boseman29-Oct-14 8:00 
AnswerRe: Code Samples Pin
ZurdoDev29-Oct-14 8:09
professionalZurdoDev29-Oct-14 8:09 
GeneralRe: Code Samples Pin
Brandi Boseman29-Oct-14 8:22
Brandi Boseman29-Oct-14 8:22 
QuestionRe: Code Samples Pin
ZurdoDev29-Oct-14 8:24
professionalZurdoDev29-Oct-14 8:24 
AnswerRe: Code Samples Pin
Brandi Boseman29-Oct-14 8:34
Brandi Boseman29-Oct-14 8:34 
GeneralRe: Code Samples Pin
ZurdoDev29-Oct-14 8:48
professionalZurdoDev29-Oct-14 8:48 
GeneralRe: Code Samples Pin
Brandi Boseman29-Oct-14 9:03
Brandi Boseman29-Oct-14 9:03 
QuestionWorking with SlideShare API Pin
Jassim Rahma10-Oct-14 10:33
Jassim Rahma10-Oct-14 10:33 
QuestionUsing ForumConnect Pin
Zephire5-Oct-14 3:19
Zephire5-Oct-14 3:19 
QuestionCan I use PHP in client server? Pin
DarkDreamer0831-Aug-14 20:19
DarkDreamer0831-Aug-14 20:19 
AnswerRe: Can I use PHP in client server? Pin
Kornfeld Eliyahu Peter31-Aug-14 20:42
professionalKornfeld Eliyahu Peter31-Aug-14 20:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.