Jump to content

leszekmk

Members
  • Posts

    6
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

leszekmk's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Problem solved. You need to specify order of sorting (ASC or DESC) after each column name.
  2. Hi, I am trying to sort the table where I store a date in separate cells (year, month, day). When listing the ouput I want the date to be sorted either in ASC or DESC order. However, only last column in the $column variable is sorted, no matter how many columns are included in the variable. In this case I end up with sorted days but the months are not sorted. This makes me think that I cannot sort on more than one criteria (column). Am I correct? Is there a way to sort the tables in Dreamweaver on more than one criteria? Please help. Below is the code with portions eliminated for clarity. <?php $sort = ($_GET['sort']); $column = ($_GET['column']); if (!$sort) { $sort = "ASC"; } if (!$column) { $column = "eventinfo.eventyear,eventinfo.eventmonth,eventinfo.eventday"; } mysql_select_db($database, $connection); $query_rsEventData = "SELECT eventinfo.eventmonth, eventinfo.eventday, eventinfo.eventyear FROM eventinfo WHERE ... ORDER BY $column $sort"; if ($sort == "ASC") { $sort = "DESC"; } else { $sort = "ASC"; } ?> <a href = "file.php?sort=<?php echo "$sort";?>&column=eventinfo.eventyear,eventinfo.eventmonth,eventinfo.eventday">
  3. Hi, I am trying to compare an e-mail address assigned to variable $name with those already entered in the table siteusers of my database and am getting rather cryptic error message. Would you please help me identify what the problem is? I am using Dreamweaver MX, PHP 4.3.3, and mySQL 4.0.16. Thank you. $name = $row_rsEventData['whoentered']; mysql_select_db($database, $connection); $sqlone = "SELECT * FROM siteusers WHERE siteusers.userLoginName = $name"; $result = mysql_query($sqlone,$connCalendar) or die(mysql_error()); $newArray = mysql_fetch_array($result); You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '@yahoo.com' at line 1
  4. I do not see how you can list the names if you store the index number. Is there an option in DW that would handle listing two entries from one table in a single resordset? I was thinking about using aliases for that table but at the end you end up in the DW listing something that does not differentiate between two entries--in the definition of recordset rsEventData it seems like the alias is working but later whent displaying the recordset the name of the table is dropped and the script looks like this: <?php echo $row_rsEventData['contactfname']." ".$row_rsEventData['contactlname']; ?> <?php echo $row_rsEventData['contactfname']." ".$row_rsEventData['contactlname']; ?> Since the name of the table /aliases are not mentioned the two will result in duplicate output. Please help. Thank you.
  5. I use DWMX, PHP and mySQL. Using an insert form I am entering data in an event table--where a record contains, among other entries from various tables, two different entries from the same table (name of contact person 1 and name of contact person 2 coming from a table of contact people using list/menu option). When I display the content of the event table in the repeat area the recordset is supposed to list contact people data (fname, lname) but instead of listing two different data for two different individuals it repeats the data for the first contact person twice. I checked in myphpadmin and the event table has the data entered and stored properly (I store indices refering the data in the contact table for these two individuals) but in the process of specifying what to display in DWMX I end up with the same result twice since with DWMX I am unable (I do not know how) to differentiate fname, lname for the first contact person from fname, lname for the second individual. Would you please recommend the proper way to do it in DWMX? I do not want to keep two different tables with the same data (one for contact people 1 and second for contact people 2, it is the same group of people after all). Thank you.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.