Jump to content

equipment

Members
  • Posts

    52
  • Joined

  • Last visited

    Never

Everything posted by equipment

  1. I remember in the past it used to be done with Firefox add-ons, how does it look like now?
  2. Thanks a lot, I have to say that putting the space before the vertical pipe will work better because it will keep the vertical pipe with the tag together, they can both break apart at the breaking point if the space will be after the vertical pipe.
  3. I already posted it, do look at the link in the post above yours.
  4. I thought of it as not an HTML or CSS problem, that is the reason why I suspected the while loop for this case. Take a look at the live example here: http://www.emoticonsymbols.net/model/contribution/knuffix_list.php?cat=All The two series of tags above and below are in the exact same div with the exact same id="labels", though the lower one which is being printed off the while loop does break out. Developer tools can be used for the HTML or CSS.
  5. <?php # This database request does get included into the file: knuffix_list_category_sort_automatic_1.php # for the sake of printing the tags list. # Printing of the tag names in ascending order by tag_id $db_connect = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $sql_get = "SELECT DISTINCT tag_id, tag_name FROM tags ORDER BY tag_id ASC"; $sql_run = mysqli_query($db_connect, $sql_get); # $sql_assoc_tag_id = mysqli_fetch_assoc($sql_run); ?> <div id="labels"> <a href="?cat=All">all</a> <?php while($sql_assoc = mysqli_fetch_assoc($sql_run)){ echo '<u>|</u>' . '<a href="?cat=' . $sql_assoc['tag_id'] . '">' . $sql_assoc['tag_name'] . '</a>'; } ?> </div> The list created in the while loop is breaking out of the div wrapper, even though it should not. It should break into new lines at the side of the div wrapper. What is causing it to not break at the side of the div wrapper? And how can I solve it?
  6. I outlined the rules clearly in the first post: And then I wrote an example like this, before xyph would post: To make you understand that in marketers terms, I want to build a tag system which should only accept this: example-string And that is enough one needs to know, simply enough to know, simply enough to know, simply enough to know, simply enough to know, simply enough to know.
  7. xyph, that is a good starting point, how can I now add the following conditions to only have? 1. only lower case letters are possible 2. no other special characters, including white space are possible 3. and only one hyphen is possible
  8. Well it is just like that, it is for inputted data through an input field, simply a literal string with maximum one hyphen should be allowed not more, solely alphabetic with no special characters. I just have problems wrapping my head around preg_match example-string
  9. How could this be achieved with preg_match? It should be solely alphabetic (lower case) with no special characters and only one hyphen should be allowed.
  10. I just checked it, it indeed is the line-break in the text area, even when it is a short text-string with spaces, as soon as the string breaks at the side of the textarea field it will not work anymore. By the way I simply want alphabetic characters to be entered with no special characters. Is there a way to achieve it with the line-breaks or an alternative you would suggest? What do you mean by that?
  11. <?php # This script does get included into the document create_new_tag_from.php if(isset($_POST['tag_name_submit'])){ $tag_name_submit = $_POST['tag_name_submit']; } if(!empty($_POST['tag_name'])){ $tag_name = strip_tags($_POST['tag_name']); } if(!empty($_POST['tag_description'])){ $tag_description = strip_tags($_POST['tag_description']); } if(isset($tag_name_submit)){ # The Validation of User Entered Data # Do validate for solely alphabetic characters with ctype_alpha # ctype_alpha($tag_name) && if(ctype_alpha($tag_description)){ $tag_name = strtolower($tag_name); $tag_description = strtolower($tag_description); # The Insertion Into the Database $db_connect = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); # Do research if SQL query has to be modified into a PHP comform query $sql_query = sprintf( "set @newid = convert( ( select max(convert( (substring(tag_id, 2)) , unsigned integer))+1 from tags), char(10) ); set @newid = if(length(@newid) = 1, concat('0', @newid), @newid); set @newid = concat('c', @newid); INSERT INTO tags (tag_id, tag_name, tag_description, added_by_user_id, creation_date, last_edited) VALUES (@newid, '%s', '%s', 7, now(), '0')", mysqli_real_escape_string($db_connect, $tag_name), mysqli_real_escape_string($db_connect, $tag_description) ); $sql_query_run = mysqli_multi_query($db_connect, $sql_query); # Print Test to See If It Works echo "works_ "; echo $tag_name . "_ "; echo $tag_description . "_ "; } else { # End of the Validation echo "The entered data must be in alphabetic characters."; } } ?> Here is the form: <?php include_once('../../header.php'); include_once('../../model/contribution/create_new_tag_script.php'); ?> <form action="" method="post"> <input type="text" name="tag_name" value="" /> <textarea maxlength="60" type="text" name="tag_description" value=""></textarea> <input type="submit" name="tag_name_submit" value="Submit the New Tag" /> </form> <?php include_once('../../footer.php'); ?> By the script as given above the conditional check will skip to the error message. Though I have to say that ctype_alpha does return TRUE when I do try it with "tag_name" which is entered data from the input field, while the other is from the textarea. I simply cannot see the reason for the returned FALSE.
  12. Thanks a lot, worked like a charm. It can be that easy as well.
  13. This is something I put together, I would like to know, how does it have to be rewritten to be PHP comform? # The Insertion Into the Database $db_connect = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $sql_query = sprintf( "set @newid = convert( ( select max(convert( (substring(tag_id, 2)) , unsigned integer))+1 from tags), char(10) ); set @newid = if(length(@newid) = 1, concat('0', @newid), @newid); set @newid = concat('c', @newid); INSERT INTO tags (tag_id, tag_name, tag_description, added_by_user_id, creation_date, last_edited) VALUES (@newid, '%s', '%s', 7, now(), '0')", mysqli_real_escape_string($db_connect, $tag_name), mysqli_real_escape_string($db_connect, $tag_description) ); $sql_query_run = mysqli_query($db_connect, $sql_query); As of yet I could execute the script and would not get error messages, though also no data would be entered into the table.
  14. Addendum: I misunderstood your posts, I do understand now, after thinking it through, by what you meant with "multiple columns", it can represent a series in an array, as in an array in an array, and this that one somehow needs to be defined as well.
  15. It can be c100 and further, because the c, which initially was a sign for "category" has by now no meaning anymore, as said it happened in the past, but taking it out of the system requires over hauling everything, and that is really not necessary. I prefer a workaround in this case.
  16. On an old project because of not thought through design I have a column which actually should be set to auto_increment, though it cannot be because it are alphanumeric entries as follows: c01 c02 c03 Now I need a way to imitate the auto_increment functionality with the SQL statement myself, my own attempt has gotten as far as the following: INSERT INTO tags (tag_id, tag_name, tag_description, added_by_user_id, creation_date, last_edited) VALUES (SELECT(MAX(tag_id)+1), 'Love', 'All about love', 7, now(), 0); This one does not work as is, though the idea was to select the highest entry in the column "tag_id" and then simply increase it by the value 1. Any ideas how to accomplish this? By the way I am also not sure if you simply can increase an alphanumeric entry through this way, though I know it can be done, I just don't know how.
  17. [...] Even if the query only returns one column the code is still going to generate an array with a key for the column, and when you access it you will have to specify the key. Should you not be specifying the column entries rather than the column name itself? Because after all the column entries are at quantity and would have to be selected if necessary, whereas the column is only one with distinctively selected entries all assigned to the array. Would that not make more sense? Since PHP the language is trying to be as efficient as possible.
  18. Why would the array contain multiple columns, when only one has been selected in the SQL query?
  19. Thanks a lot, it is working now, I did miss that the function is fetching it and then assigning it, though it does get regarded when executing the while loop. What about the printing of the array, is the identifier of the column name really necessary when it is already identified in the SQL query?
  20. kicken, are you addressing the conditional check, I am not clearly seeing where the "drop" is happening as you call it, though I do understand the logic of your writing.
  21. As said the SQL statement works fine in MySQL. Regarding the array, is there are way to write out the array without the identifier, e.g. array[]. I am simply thinking to myself that the column is already identified in the SQL statement.
  22. $db_connect = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $sql_get = "SELECT DISTINCT category FROM con"; $sql_run = mysqli_query($db_connect, $sql_get) or mysqli_error($db_connect); $sql_assoc = mysqli_fetch_assoc($sql_run); while($sql_assoc = mysqli_fetch_assoc($sql_run)){ echo $sql_assoc['category']; } From the column "category" I get printed 5 distinct entries, though the SQL statement itself does print out 6 distinct entries in MySQL, which is the right one. Just wondering why does the while loop leave out one entry? Also in the array is the "category" identifier necessary since it is identified in the SQL statement already? How would it look differently?
  23. I am not looking to use the screen of the laptop, it is a separate display and a separate keyboard. Which I consider a sense making set up. Anyway, thanks for the response, because I found a good switch box (that is how actually call them), it is for VGA. I am wondering do you know of a good one for USB?
×
×
  • 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.