
mdemetri2
Members-
Posts
79 -
Joined
-
Last visited
Everything posted by mdemetri2
-
Ok thanks Psycho, I was kinda coming to that conclusion myself about the schema being wrong....so I will take a look at amending it I think. Thank you so much for the tips!
-
Hi. I have a table that I been to summarise, but use its column / files as rows, in otherwords transpose the table. Structure example is: id | month | CatA | CatB | CatC | CatD 1 jan 23 34 33 78 2 feb 21 38 67 78 2 mar 18 42 76 80 and would like to display: Jan Feb Mar CatA 23 21 18 CatB 34 38 67 CatC 33 67 76 CatD 78 78 80 Is this possible? Really appreciate any pointers.
-
I have tried the implement that unsuccessfully. I needed it as part of a post - when the form gets submitted. I will keep trying, thanks.
-
thanks for the reply Barand. I was trying to avoid replacing what I have with a new type of date picker. Anyone have any ideas on whether what I'm asking is possible? Thanks in advance.
-
Hi I have a javascript calendar that populates a form field (survey) in the format of dd/mm/yyyy. I don't know of a method to change the format in the calendar. So, I would like the format to be changed at the point the form is submitted and the date is used to update a record. I have tried to amend the portion of the update script for the survey field to change the format as part of it submitting the change. I used this line: GetSQLValueString(date("Y-m-d, strtotime("$_POST['survey']), "text") but I'm not getting the expected results, essentially from the text field entry format of dd/mm/yyyy I want Y-m-d Is this possible? Thanks in advance.
-
Display Dynamic Text Dependent on Variable
mdemetri2 replied to mdemetri2's topic in PHP Coding Help
Ok so in the end I managed to figure this out myself. Thanks for the replies from those who made suggestions. -
Display Dynamic Text Dependent on Variable
mdemetri2 replied to mdemetri2's topic in PHP Coding Help
jazzman1 - I don't see why I need to. -
Display Dynamic Text Dependent on Variable
mdemetri2 replied to mdemetri2's topic in PHP Coding Help
jazzman1 - I'm not sure you understand. When I say table, I mean html table populated with query results..... -
Display Dynamic Text Dependent on Variable
mdemetri2 replied to mdemetri2's topic in PHP Coding Help
jazzman1 - One user can only be associated with one type....so type 1 sees table 1, type 2 sees table 2 etc. -
Display Dynamic Text Dependent on Variable
mdemetri2 replied to mdemetri2's topic in PHP Coding Help
Well, the variable would be $usertype = $row_user['type'] , essentially the result of a query based on '$_SESSION[MM_Username]'. Result would be numeric so user type 1,2 or 3 Example code for one table in my first post. The other two would be the same, but use different recordset / queries to populate. Hope this makes sense. -
Display Dynamic Text Dependent on Variable
mdemetri2 replied to mdemetri2's topic in PHP Coding Help
Thanks for the replies. The idea is, depending on the type of user logged in (identified by a variable brought back once the user is logged in) then a different table is displayed - as the query to populate the table is different for each table. -
Display Dynamic Text Dependent on Variable
mdemetri2 replied to mdemetri2's topic in PHP Coding Help
Ok, so it is possible as I was thinking. I'm just not clear on how to achieve it at the moment. Easy bit is setting a variable based on a return from the user logged in. Its then doing an if else scenario on the table to display the corresponding result set or having the three tables visibility altered depending on the variable returned.....the latter requiring java script I believe. -
Hi I expect this is possible. If I have three recordsets but one table. Is it possible to alter the results displayed in the table dependent on a variable e.g. returned from the person logged in. Or maybe its case of have the three tables but only displaying them when the variable is to x, y or z? So currently, I have one table that displays content, code extract. <table width="593" border="0" class="TableContent"> <?php do { ?> <tr> <td width="575" class="TableContent2"><a href="R/zzedit.php?id=<?php echo $row_retail['id'];?>&ref=<?php echo $row_retail['property'];?>"><?php echo $row_retail['id']; ?></a><?php echo $row_retail['item']; ?><?php echo $row_retait['route']; ?><?php echo $row_retail['class']; ?></td> </tr> <?php } while ($row_retail = mysql_fetch_assoc($retail)); ?> </table> Would be great for anyone to point me in the right direction on this or provide some assistance. Appreciated. mdemetri2
-
Barand - thank you, that worked perfectly for what I required. Appreciated as always. thanks!
-
Barand, as usual quick response, I will certainly give that a try,.....will let you know how things go. thanks!
-
thanks for the reply gristoi, I am unable to change the field type at this time but if that is the only way then I suppose I will have to at some stage. I thought there might be a way round it though.
-
Hello there Hoping someone might be able to steer me in the right direction here. I have a varchar field that is used to record a date stored in format Y-m-d H:i:s (e.g. 2013-08-07 09:20:46) I would like to run a script that means I can query this field, and allow me to do a between date a and b. Is this possible due to it being stored as a varchar and in such a format? Many thanks mdemetri2
-
spot on! you are a star, very much appreciated Barand!
-
Hi I'm sure this should be straight forward but I keep getting errors, so I have a query: Select * from table where STR_TO_DATE(updatedate, '%d/%m/%Y : %H:%i') >now()-1; I essentially want any records that have been updated sometime today to be brought back and I know now()-1 would be timenow minus 1 day if the syntax above is correct. I know there are some records as I have updated some for testing purposes. I think the issue is where I am needed to convert the string held date....any ideas? Thank you so much in advance.
-
I was asking whether it was possible to amend it to show 'No Records' when there were no results from the query......rather than the table just displaying no row / content at all. I will take a look at a while loop, and find out you mean by the other fetch - it could be to do with the repeat region - and obviously dreamweaver will also be adding code that might not be necessary.....but I wouldn't know what to remove - noob, remember....using dreamweaver might not be the best way to learn (or not as the case may be) but that is what I am using. Thank you for your continued help, it is appreciated - even though it might be simple stuff for you!
-
sorry wrong terminology, I meant the code that works for striping the rows: <?php $count = 0; do { ?> <tr> <?php $count++;?> <td colspan = "5" class="<?php echo (($count % 2) == 0) ? 'even' : 'odd'; ?>"><?php echo $row_RecordSet1['userid']; ?></td> </tr> <?php } while ($row_RecordSet1 = mysql_fetch_assoc($RecordSet1)); ?>
-
Hi, been playing around with this and not getting anywhere, still stuck with the original code. Anyone?
-
it's something that has been in place for a while and not changed, so thought I would just carry on with it. Playing around really. I will take a look at what you suggest, and maybe look at an alternative login script.... Thanks again.
-
So far wonderful help, thank you. To extend on this a little, is it possible to alter the now working code, so that it says 'None' if there are no records returned by the query? So I imagine a check that says if the recordset count = 0 then echo 'None'....?
-
holy crap lol. I just amended what I had to this: <table width="600" border="0"> <tr> <td>User</td> </tr> <?php $count = 0; do { ?> <tr> <?php $count++;?> <td class="<?php echo (($count % 2) == 0) ? 'even' : 'odd'; ?>"><?php echo $row_recordset1['userid']; ?></td> </tr> <?php } while ($row_recordset1 = mysql_fetch_assoc($recordset1)); ?> </table> And it bloody works! However is it a messy way of doing it? And...I dont really understand what is goind on specifically! BUT Jessica you have been excellent help....can you recommend any decent books for this stuff?