Jump to content

mds1256

Members
  • Posts

    259
  • Joined

  • Last visited

Everything posted by mds1256

  1. the query should be: select id, newsTitle from tbl_newsArticles order by id desc
  2. Nope, still doesnt work. I am wanting to substitute the field name not a value, so for example: call sp_selectNewsArticles('fieldNameHERE') would actually run the following SQL: select id, newsTitle from tbl_newsArticles order by fieldNameHERE desc;
  3. Not according to this http://www.mysqltutorial.org/stored-procedures-parameters.aspx It should be a temp parameter name which can then be used in the procedure.
  4. Don't think this is what I want to achieve I want the dynamic part (the IN parameter) to replace the fld field in the SQL code, the table will stay the same
  5. mds1256

    MYSQL LIMIT

    why that number?
  6. example code that doesnt seem to work -- -------------------------------------------------------------------------------- -- Routine DDL -- Note: comments before and after the routine body will not be stored by the server -- -------------------------------------------------------------------------------- DELIMITER $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_selectNewsArticles`(IN fld VARCHAR(255)) BEGIN select id, newsTitle from tbl_newsArticles order by fld desc; END call sp_selectNewsArticles('id');
  7. because the same query is used in many places within the site.
  8. mds1256

    MYSQL LIMIT

    Hi is there a way to use the LIMIT keyword but return all rows. I am wanting to build a dynamic stored procedure that allows you to pass in a parameter to limit rows if you want to. e.g. select * from users limit ** ----- where ** could be a number or all I can get it to work with a number but If I want all rows what would I put in place of the **'s
  9. Hi Struggling with the following: I am wanting to build a dynamic stored procedure to allow you to pass in parameters for the order by column e.g. select * from users order by id desc I want to use the ID part as a parameter so I would call as follows: call selectUsers('id') but when I do that it doesnt apply the descending sort... I am sure I am missing something. Can any one help me with this one? Thanks
  10. Thanks very much for the comments, very helpful
  11. With the new EU law what is the done way to disable cookies dynamically. Give the user the option to opt out but how does this work behind the scenes?? Is it Javascript or PHP, and how is it implemented?
  12. I sorted this, I basically put the background-color:inherit; before the background:url etc and that worked
  13. Hi I have an input button which has a background image, I have set the color to #FFFFFF so the text value of the button is white and set the bacground color to transparent (if i put inherit it is putting a white background on the button and since the button has rounded corners you can see the white on the corners) No I know they are only warnings but I want to try and get it free of warnings, (i have whole site built with this being the only warning). What way can I change the css to get rid of the no background / transparent warning. I tried setting a background color of transparent on its parent (which is a DIV) and then then trying to inherit but it still comes out as white. example of code <div id="formWrapper"> <form name="nameHere" method="post" action=""> .......... more fields here ............ <div id="formBottomWrapper"> <input type="submit" class="button" name="submitButton" id="submitButton"> </div> </form> </div>
  14. I have just decided to store a true / false value in a session variable and use this to decide if the username or password is incorrect. seems to work.
  15. sorry the above is not the exact code and it s mixture of pseudo code and php...
  16. I have a div on my webpage that will contain an error message, basically 'username or password incorrect.' At the moment on the login page I have the div containing: <div id="errorMessage"><?php echo $errorMessage; ?></div> and in the php code i have: $errorMessage = ""; if(isset($_POST['username'])) { // check if username and password exists // else $errorMessage = "username or password incorrect"; } but unfortunately this doesn't seem to show on the page, any ideas?
  17. I have now sorted this by reorganising my code. Thanks for the response above it helped a lot
  18. Good idea, never even thought of that! Although I start the session in the header file, is it ok to call session start twice? E.g. Session start If session-isloggedin = false header redirect to login page End if Include header (which also includes session start) From the pseudo code above is that ok or is there a better way! Thanks
  19. I will explain my scenario and if anyone can give me an idea on how to accomplish it that would be great. I have included a header file which contains my html meta tags and banner. I then have a footer file which contains my end html tags and my site's footer. Then I have the individual pages e.g. contact us, home, etc and I include the header and footer file within these documents so I only need to edit the header / footer in one location. My dilemma is that on one of my pages (myprofile page) I want it to check if I have logged in first, if not then re-direct to the login page. But when checking for my session variable (isLoggedIn) which is turned from false to true when user has successfully logged in and then using header location to redirect to a login page if it is not equal to true it returns that headers are already sent (which I know as the html from my header has already been loaded). Now the first thing I thought about was to check this in the header but when browsing the home page I dont want users having to login before viewing the home page or contact us page. Any idea on how I can achieve this? Thanks
  20. Have kind of thought about that one and I regenerage the session ID after so many page requests to get a new ID. So on another note what is the best way to divert my site to https if a http is entered, I am using IIS for this, is there an easy way of doing this that will prevent users from visiting the http version.
  21. They also have huge farms of powerful servers lol, but yes I take your point.
  22. But doesnt that increase server load? And really the only sensitive information is the username and password being posted in clear text.
  23. Hi I am developing a system that users can log into. Couple of questions: 1. Should I use SSL for when users submit the login form e.g. post to https just for login? 2. Is putting the https address in the form action enough to encrypt the login details or does the page that you are entering the details on (e.g. the login form webpage) also need to be encrypted? Thanks
  24. sorted it, just had to unpick it all, no easy way
  25. I have a windows VPS and it comes with PLESK installed and the vps provider doesnt do an image without a plesk install. I basically just want to uninstall plesk and start from scratch, I followed the instructions from the Parallels website to uninstall and this kind of worked but left config lying about in IIS. Any quick way to do this?
×
×
  • 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.