Explore Comments

Explore / Pages

shacker commented on a Page, CSV to mySQL - Create Table and Insert Data  -  5 days ago

The issue I hit with this script is that it assumes all data in your CSV will fit into a varchar field, limited to 255 characters. But some of my data needs to go into TEXT fields with unlimited length. Unfortunately there's no way for the script to know in advance what kinds of fields to create in the db. And because the final line of the script, which does the loading, does not report errors, it fails silently (very mysterious).

CyberMage commented on a Page, CSV to mySQL - Create Table and Insert Data  -  Jun 09, 2014

Love it - saved me some time. I had someone send me a 250 MB file with 57 tilde delimited fields that I needed to import, and PHPMyAdmin of course doesn't like big files. A couple of tweaks to your script and it worked like a charm.

 Respond  
radius314 commented on a Page, CSV to mySQL - Create Table and Insert Data  -  Mar 29, 2014

Slight flaw in the script, as if the column name contains a reserved keyword. Say for example the word "DELETE". In this case the column variable should be wrapped in back ticks (`) to escape this.

Typo commented on a Page, Random Token Generator  -  Mar 08, 2014

I have made some serious enhancements so if you looked at this before reading this post, look again as if its new.

 Respond  
Typo commented on a Page, Random Token Generator  -  Mar 06, 2014

I had formatted the description with indenting on the examples but all the leading spaces were stripped when I posted it here. Sorry if it turns out to be a bit difficult to read.

EDIT* I will be updating this function tonight with additional functionality.

F*U*R*B*Y* commented on a Page, Basic PHP IRC Bot  -  Mar 05, 2014

chuck in a

elseif ($rawcmd[1] == "hi") { fputs($socket, "PRIVMSG ".$channel." :Your message goes here\n"); }

 Respond  
I_Is_Payton_ commented on a Page, Basic PHP IRC Bot  -  Mar 03, 2014

How would you make it say something if a user sends "Hi" in chat?

 Respond  
jo19 commented on a Page, Latest post on your homepage ( phpbb )  -  Jan 01, 2014

Thanks for the code, which works perfectly with phpbb3, but I have an issue to display the German umlaut in my website. If applying the code I just see a � instead of the umlaut Ä, Ü or Ö. Can sombody support what I have to put in the code to have displayed the umlaut correctly? (both database and website are in UTF-8) Thanks in advance.

 Respond  
ryangurn commented on a Page, Capture Screenshots in PHP  -  Dec 27, 2013

The best application that i have seen for taking screen shots is a nodejs application that can easily called from php... It is called screen shot as service. This is the github for the application. https://github.com/fzaninotto/screenshot-as-a-service

 Respond  
Typo commented on a Page, [PHP] mIRC Identifier Library : mIRC.lib.php   -  Dec 18, 2013

This is pretty cool. I would never use something like this but I like that you took the time to try and do it :) .

Neat, I remember doing this stuff in my 3D programming class.

TMFKSOFT commented on a Page, Minecraft Random Item Game Plugin using rcon  -  Dec 02, 2013

Well trying it with 1.7.2 dont work pretty much. Its more a case of. Variables dont even exist.

PHP Notice: Undefined variable: done in /home/mc/vanilla/mc_items.php on line 47 PHP Notice: Undefined variable: no_mode in /home/mc/vanilla/mc_items.php on line 50

and so on :P

@Hawkee do you believe there is a way to do exactly this think with smaller code? Are there any tweeks can be made to this code? What's your opinion?\

CreativeDesign commented on a Page, "Sort by" Box for Lists  -  Nov 18, 2013

Hawkee is great ^_^

 Respond  
console commented on a Page, PHP IRC Bot v2  -  Nov 16, 2013

I get This error:

PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead in /BLAH/ircbot/bot.php on line 236

 Respond  
Noutrious commented on a Page, Code to redirect after successful submission of form  -  Aug 27, 2013

Not sure if this in any way is worth submitting

 Respond  
Hawkee commented on a Page, Code to redirect after successful submission of form  -  Aug 24, 2013

Please remove the link drop.

Neo139 commented on a Page, CSV to mySQL - Create Table and Insert Data  -  Aug 18, 2013

Thanks! PHP Notice: Use of undefined constant argv - assumed 'argv' in import.php on line 14 PHP Notice: Undefined variable: columns in import.php on line 35 PHP Notice: Undefined variable: columns in import.php on line 36 to remove the last two warnings change the foreach for: foreach($frow as $column) {

    $ccount++;
    if(isset($columns)) $columns .= ', ';
    else $columns="";
    $columns .= "$column bigint(20)";

}

Bipster commented on a Page, Latest post on your homepage ( phpbb )  -  Aug 13, 2013

All I can get to display is Could Not Connect. From what I can tell that's displayed if login fails? I am still trying to re-teach myself some of this stuff after a lengthy break in web dev. My URL path I put in the URL not referencing the folder relative to where the file is. Am I supposed to put my login and password in the code or let it call it from the config.php file?

Any help would be appreciated.

 Respond  
Hawkee commented on a Page, IMDB script to Find rating of a movie  -  Aug 04, 2013

Simple little command line script, but for the sake of security I'd probably filter out anything but alphanumerics from the input. Would also be neat if it gave the Rottentomatoes rating and audience rating.

F*U*R*B*Y* commented on a Page, Latest post on your homepage ( phpbb )  -  Jul 22, 2013

show us line 15-20 to help you

gerbil commented on a Page, Latest post on your homepage ( phpbb )  -  Jun 22, 2013

Parse error: syntax error, unexpected '<' in /home/user/public_html/config.php on line 18". What I'm doing wrong? Please help.

 Respond  
Hawkee commented on a Page, ctype_alnumi   -  Jun 21, 2013

I can see where this would be very handy.

Hawkee commented on a Page, Redirect Users when your site is down  -  Jun 15, 2013

Interesting, but if the site is down how will this script get executed?

TMFKSOFT commented on a Page, PHP Dateify!  -  May 23, 2013

@sean Agreed I soon discovered that were showing the undesired result along with another issue. Im still working on it.

 Respond  
Hawkee commented on a Page, PHP Dateify!  -  May 22, 2013

I posted something very similar, but yours seems to be a bit more flexible: http://www.hawkee.com/snippet/9368/

 Respond  
sean commented on a Page, PHP Dateify!  -  May 22, 2013

I agree with the "over coding" statement but, this is certainly a good start. I urge looking further into the date() function (specifically the 'M' flag), as your last line could have been

date('M j, Y', $stamp);

Also your suggestion about appending 'ago' will provide undesired results after 24 hours. (ex: May 22, 2013 ago).

Sidenote: I've made a similar function some time ago here, if you'd like a friendly reference :) I hope to see more PHP contributions!

 Respond  
MoshMage commented on a Page, PHP Dateify!  -  May 22, 2013

Not bashing on you, but you're overcoding. you could've floored the $stamp and then divide that value to get days, hours, mins and seconds. But i guess your way works as well :)

 Respond  
Hawkee commented on a Web App, MakeFirstMove.com  -  May 01, 2013

I would call this a web app rather than a PHP app.

tomi commented on a Page, Simple GuestBook  -  Jan 22, 2013

how to make the most recent post appearing first ?

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.