How to get available values for SET field?

Kirzilla’s Question: Kirzilla Is there any way to get available values for SET field in table? Thank you. Andy You can retrieve the possible values for a SET field using DESCRIBE myTableName mySetColumn or SHOW COLUMNS FROM myTableName LIKE mySetColumn: mysql> DESCRIBE myTableName mySetColumn; +——-+——————————————-+——+—–+———+——-+ | Field | Type | Null | Key | Default […]

Copy table row data to a form in html

Joel Paxton’s Question: Joel Paxton I have a page which has a form/table. I want to be able to click on a button at the end of a row, or the row itself and copy this data into another form on a separate html page, which can then be edited. I know it probably has […]

Using .on() and targeting elements with a specific ID

Brandon Durham’s Question: Brandon Durham I understand you can use .on() to attach a single click event to an element and then specify which child elements receive the click. So, for example: $(this.el).on(“click”, “span”, function () { alert(“Bloop!”); }); I need to be a bit more specific and target selectors with a particular attribute, like […]

How to turn variable name into string in JS?

Jehan’s Question: Jehan I am trying to write a convenience wrapper for console.log, and I would like to print any variables passed in along with their contents. Can I turn a variable name into a string in js? Starx There is a possibility. And here is how var passed_variable = ’65’; // The actual variable […]

Set content-type on blob

Chris Nolet’s Question: Chris Nolet We’re transferring a Blob (image) down a websocket and rendering it to a canvas on the other end. When I use createObjectURL with the blob, I get this error: Resource interpreted as Image but transferred with MIME type text/plain: “blob:https%3A//staging.app.io/23f53ce3-5a52-4e12-8686-190eb15a9ede”. We create the object URL using the following code. The […]

insert </br> after comma with php

Vektor’s Question: vektor I array text from custom field “black, grey, white” with this code: <?php global $wp_query; $postid = $wp_query->post->ID; echo get_post_meta($postid, ‘colors’, true); ?> I want show me like this: black</br> grey</br> white It’s possible with PHP? Many thanks Starx Use str_replace(): echo str_replace(“,”, “<br />”, get_post_meta($postid, ‘colors’, true)); Source: Insert </br> After […]

Log in script load users name

User2827404’s Question: user2827404 ive just built a php and mysql log in script which forwards to a members area. I now want the members name that loged in to be displayed, somthing like welcome Stephen for example. what would be the best way to do this? ok this is my code once the submit button […]

Devil of a time with jQuery delegate and .not

James Emanon’s Question: james emanon I’ve searched hi and low but couldn’t find a solution. I’ve tried everything.. but can’t get this thing to work. NOTE: Can’t use “.on()” . Using an older version of jQuery that only supports .live/.delegate basically, I have a very involved webpage.. and there are event handlers flying everwhere.. BUT, […]

Convert String in Array JQUERY

User2789569’s Question: user2789569 I have the data array return of the server : data.arr = [[Date.UTC(2013, 9, 17),1],[Date.UTC(2013, 9, 18),5],[Date.UTC(2013, 9, 19),2],[Date.UTC(2013, 9, 20),4]] [0] “[Date.UTC(2013, 9, 17),1]” String [1] “[Date.UTC(2013, 9, 18),5]” String [2] “[Date.UTC(2013, 9, 19),2]” String [3] “[Date.UTC(2013, 9, 20),4]” String I need to pass only value to a function that recepeit […]