Posts by Otto • 5,653 points
186 posts
-
1
votes2
answers60
viewsA: "Mage_chronorelais_helper_data'" class not found in Magento
inside: public static function helper($name) { put it like this: public static function helper($name) { echo $name; die; so you find the real name of the helper being called and can query who is…
-
0
votes2
answers1253
viewsA: How to add a javascript variable in PHP?
You’ll have to do it this way: <SCRIPT language=javascript> var vetor_dados ="text"; </SCRIPT> <?php $conteudo = "<script>document.write(vetor_dados)</script>"; echo…
-
0
votes2
answers993
viewsA: PHP how to pick up image, in hexa format straight from MSSQL?
You can use 'pack' : $binary_string = pack("H*" , $hex_string);
-
-3
votes4
answers23882
viewsA: How to create a permissions control system
The system will consist of a simple login, validated by user and password (encrypted) against a table in the database and storing the data in the session. There will be two levels of access for our…
-
2
votes1
answer182
viewsA: Problem when redirecting Own DNS to an ip outside of my server.
You must create the record type AA pointing to the ip where the application/site is hosted
-
5
votes2
answers2420
viewsA: Checking nearest branch of a zip code
See if this information helps anything: 1. x0000-000 (Região) 2. 0×000-000 (Sub-Região) 3. 00×00-000 (Setor) 4. 000×0-000 (Sub-Setor) 5. 0000x-000 (Divisor de sub-setor) 6. 00000-xxx…
-
12
votes2
answers640
viewsA: How to print the SQL statement that is being sent to the database?
Thus echo $sql ->queryString
-
1
votes1
answer94
viewsA: How to get all function calls from a php script?
A demonstrated reasonable solution in this answer Stack Overflow creates a class called Debug and include it above any file you want to debug. class Debug { private static $calls; public static…
-
-1
votes2
answers4048
viewsA: Return which of the query items are not in the table?
I could use something like that SELECT id FROM tabela WHERE id NOT IN (1,23,45,68,91,126,345,418,509,610);
-
1
votes3
answers306
viewsA: Yii authentication via user module
You can do yes, but you will need to create the model and adapt the login functions to get the new model with its rules. I still think it would be more practical to log in from scratch.…
-
1
votes2
answers381
viewsA: Text that slides when hovering the mouse
Da to use the Jquery Marquee Adapting only to your need. var $mq = $('.marquee').marquee(); //Pause $('.p').click(function(){ $mq.marquee('pause'); }); //Resume $('.r').click(function(){…
-
3
votes5
answers57768
viewsA: Count equal records with SELECT DISTINCT and COUNT
See if this helps you: select COUNT(distinct Nome) from @TableTeste
-
0
votes1
answer131
viewsA: More of a relationship in the same model
Look at an example of One to Many and of course more examples and documentation on Laravel.com <?php class Category extends Eloquent { /** * The database table used by the model. * * @var string…
-
14
votes2
answers3291
viewsA: Crop image with Javascript
Initial settings As it comes to a jQuery plugin we need the call to the library somewhere in our HTML. In addition, we will also need to include the jCrop source file with its required style sheet…
-
1
votes3
answers616
viewsA: Carousel bootstrap with two items upright
You can use this plugin that solves your problem: https://github.com/tutorialdrive/Bootstrap-Vertical-Thumbnail-Carousel…
-
5
votes1
answer517
viewsA: Identify element in an image with PHP?
There is a javascript library of face Detection, adapting it I believe suits your need: http://facedetection.jaysalvat.com/
-
1
votes2
answers1973
viewsA: Select line in datatable and get id
With this code you will get the contents of the column: $('th').click(function(){ alert($(this).html()); }); You just have to adapt your need.
-
3
votes1
answer1569
viewsA: How to compare two images with PHP?
Image comparison in php is used with the library imagemagik as follows <?php $image1 = new imagick("image1.png"); $image2 = new imagick("image2.png"); $result = $image1->compareImages($image2,…
-
2
votes2
answers141
viewsA: Turn string to uppercase before dash
You can do it like this: $('textarea').keyup(function(){ var mystr = $(this).val(); var myarr = mystr.split("-"); var myvar = myarr[0].toUpperCase() + "-" + myarr[1]; }); Using the split to separate…
-
1
votes3
answers78
viewsA: Wordpress content
A simple function to load the page content in wordpress would be like this: The function: function get_first_page_content($id){ $page_id = $id; $page_data = get_page($page_id); return…
-
37
votes3
answers59486
viewsA: How to compare dates in PHP?
In order to be able to work with date first of all we have to keep in mind that the standard used is the American standard which requires us to use the Year-Month-Day format (Ex.: 2013-05-22). In…
-
1
votes3
answers21786
viewsA: Array inside array... using push arrays
I think what you’re looking for is something like this: $first = array('doh', 'ray', 'me'); $second = array('fah', 'soh', 'lah', 'te', 'do'); echo "Union: ", var_export($first + $second, true),…
-
0
votes2
answers142
viewsA: How does the file receive the $_POST?
Another thing that can be done not to need to move a lot is to use the extract(). Since you have a form with the names of the correctly defined fields, you could use extract($_POST), solving the…
-
2
votes1
answer129
viewsA: How to add Midia in Wordpress Library programmatically?
The following function has been developed to import photos from another site, but can be adapted to your need. You could do something like this: function _import_photo( $postid, $photo_name ) {…
-
2
votes1
answer392
viewsA: PHP x Proxy Authentication
I managed to solve using this post: http://www.learncomputer.com/php-ldap/ Using php native functions for LDAP http://php.net/manual/en/book.ldap.php…
-
1
votes1
answer228
viewsA: View [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]
For UNDEFINED, Mysql chooses which algorithm to use. It prefers MERGE over Temptable if possible, because MERGE is generally more efficient and because VIEW cannot be upgraded if a temporary table…
-
8
votes1
answer318
viewsA: SQL history query
If you want to search from the current date, you do not need to enter any date variable. Mysql is smart :), and is able to account for when it is seven days in the past. Do so: SELECT * FROM tabela…
-
3
votes1
answer4847
viewsA: "Failed to connect to 127.0.0.1:27017, Reason: Errno:111 Connection refused" starting mongodb
Yes, you could create / data / db at the root . The Mongodb documentation suggests the following command for creation mkdir -p /data/db . As for your second question, also yes. Since Mongo Daemon…
-
2
votes2
answers71
viewsA: How to apply Opacity to IE8
Ta ai .transparent_class { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; // first! filter: alpha(opacity=50); // second! /* Netscape */ -moz-opacity: 0.5; /* Safari 1.x */…
-
2
votes1
answer392
viewsQ: PHP x Proxy Authentication
I have a network with proxy authentication which I do not have access to settings and a system in the internal network via PHP. The users and passwords of the PHP system are the same as AD and…
-
2
votes2
answers151
viewsA: Blog pagination, post limitation
as I had said you are thus mounting your query: $result = mysql_query("select * from blog "); And it should be so: $result = mysql_query("$busca LIMIT $inicio,$total_reg");…
-
1
votes1
answer427
views -
3
votes2
answers208
viewsA: Email check before sending
You can connect to the server, and issue a VRFY command. Very few servers support this command, but it is intended exactly that. If the server responds with a DSN 2.0.0, there is the user. VRFY user…
-
0
votes3
answers82
viewsA: Transparency of a SWF with wmode=Transparent does not work in Firefox
You could try <param name="wmode" value="opaque" /> instead of: <param name="wmode" value="transparent" /> From what I read you both have a similar function and can solve your problem.…
-
2
votes1
answer196
viewsA: Heroku task scheduler to run PHP script
I’m not sure what you mean by "performing my own scheduled tasks manually." To cron specifically, you need access to crontab, which they can control, as they are your servers. If you have another…
-
1
votes2
answers1061
viewsA: How to send data from a php filter with multiple search fields
Summing up I find post safer. The GET method GET, one of HTTP’s methods, is triggered by an HTML form via the method=get directive included in the tag. Through this method, the data in the form is…
-
1
votes2
answers686
viewsA: Display products randomly according to category
you can use something like this: {{block type="catalog/product_list_random" name="home.catalog.product.featured" category_id="60" columnCount="2" num_products="4"…
-
1
votes1
answer116
viewsA: Session_destroy() returns error
Use like this: session_start(); if (isset($_SESSION)) { session_destroy(); }
-
2
votes2
answers9250
viewsA: How to mount a select by taking information from the database
It’s like this <select name="xpto"> <?php $query = $con->query("SELECT cod_usuario FROM pv_usuario where cod_cargo = 1 and ativo = 1"); while($reg = $query->fetch_array()) { echo…
-
10
votes1
answer8631
viewsA: PHP or Java ? Positive and negative points
That being said, for your question whether PHP is always faster than Java, the answer is depends. Any comparison between two different languages will probably have this answer. Note that your simple…
-
1
votes2
answers1324
viewsA: Compare files with PHP
There is a form in example #1 in the PHP manual xdiff_file_diff() which makes unified diff of two PHP files with context length of 2. <?php $old_version = 'my_script.php'; $new_version =…
-
8
votes2
answers37795
viewsA: What does PSR mean?
I found an answer: PHP Framework Interoperability Group is a group of voting members who represent PHP frameworks and non-voting members who can participate and who have defined, so far, three…
-
9
votes2
answers37795
viewsQ: What does PSR mean?
Hello folks I recently found a term called PSR in the PHP area, but the topic was not very enlightening in defining the real meaning of the word PSR, I saw that it was related to the Object…
-
0
votes1
answer542
viewsA: Nginx wildcard DNS, with www, without www and with subdomain
I believe that using the following form can solve your problem. server_name *.example.org;
-
0
votes4
answers6839
viewsA: Block pages using login and Session
When you log in, you play the information on a Session then on all pages check if there is a Session before displaying the page otherwise redirects to the login. Note: In case it has not been clear…
-
3
votes1
answer466
viewsA: Create Rigger within a Precedent?
Yes you can do yes as follows in the microsoft example: USE tempdb; SELECT ProductNumber, ListPrice, Color INTO Product FROM AdventureWorks2008.Production.Product GO CREATE PROC…
sql-serveranswered Otto 5,653 -
-1
votes4
answers1944
viewsA: Run query that concatenates parameters (@p) in Firebird
You should do it like this: SELECT t.id || :p || t.nome FROM Test t; and not: SELECT t.id || @p || t.nome FROM Test t;
-
4
votes1
answer9990
viewsA: Java Tutorial for Reading A3 Digital Certificate
I hope this documentation helps you: Java x Certificates Documentation…
-
2
votes1
answer103
viewsA: CREATE DATABASE via a PHP script?
If your user has Create database Grant you can normally run as the example below: <?php $link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); if (!$link) { die('Could not connect: '…
-
2
votes1
answer150
viewsA: Replication Mysql Database
You can use this bank’s default dump by changing the name of the bank to a new company’s Lug. Where once registered will be uploaded this dump in mysql. ps.: I don’t know if the explanation is…