Community Member Featured
Member Avatar
Featured cereal 1,328 Replied To a Post in Problem with simple PDO insert
Topic by dottomm in Web Development
Hi,

what is the size of the array? There are few errors:

1. a syntax error: you are missing a comma between user_id and dateTime;
2. dateTime, it does not matter the case, is a [reserved word,](https://dev.mysql.com/doc/refman/5.7/en/keywords.html) so use backticks.

Also you could move `prepare()` outside the loop and use … Reply by cereal
Member Avatar
Featured cereal 1,328 Began Watching Problem with simple PDO insert
Hello and thank you in advance for any help that can be provided.
I am fairly new to PDO and am starting my first development project using PDO.

I am tryin to insert three form field values into a database. However one form field is an array.
The insert will … Topic by dottomm in Web Development
Member Avatar
cereal 1,328 Replied To a Post in [ASK] Cannot Upload to FTP
Topic by a5opyan in Community Center
How is this script working? Through command line or through web interface? Do you have access and error logs of the web server (in case of web interface) and of the FTP server? Reply by cereal
Member Avatar
cereal 1,328 Began Watching [ASK] Cannot Upload to FTP
In my php code, I make for user for upload their files, to ftp. For several months, its work. No problem at all. But recently they said cannot upload their files, which is larger than 5MB. Previously, they can upload for 300MB or more. I ask my hosting, but they … Topic by a5opyan in Community Center
Member Avatar
Topic by t_thakar in Databases
MySQL suggests LONGBLOB or LONGTEXT, however with 5.7.8 there is also the JSON data type:

* https://dev.mysql.com/doc/refman/5.7/en/json.html

I have used the blob type to save small JSON objects, it works fine. Reply by cereal
Member Avatar
Topic by t_thakar in Databases
If you can use the latest version of MySQL, then you can use JSON_REPLACE:

JSON_REPLACE(data, '$.Employee_Number', '544')

See: https://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html Reply by cereal
Member Avatar
Hi not sure if this is possible so wanted some guidance..

I have a database with 3 columns..

id, data,timestamp

id is auto increment and data is json array and timestamp is unix timestamp..

the field I wanted to update was data but I wanted to replace just a part … Topic by t_thakar in Databases
Member Avatar
cereal 1,328 Began Watching Parallel Data Entry
Hello all,
I am stuck at some logic and can't able to find stuffs for my research.I have a web based data Entry app in php.Now there will be atleast 2 operators for data entry.now when they login they will redirected to same page.I fetch one file at a time.Here … Topic by KaleBeatroot in Web Development
Member Avatar
cereal 1,328 Replied To a Post in Where To Precede The Tracking Url ?
Topic by UI in Web Development
php
> All my other scripts (mysqli and procedural) worked like this:
> if($sql)
> So, why didn't it tonight ?
> Why it only worked with oop style ?
> if(TRUE === $conn->query($sql))
> Is it because most part of the script is oop ?

No, it happens because $sql … Reply by cereal
Member Avatar
cereal 1,328 Replied To a Post in Where To Precede The Tracking Url ?
Topic by UI in Web Development
php
> I, even tried taking out the single quotes from the VALUES in the INSERT command. Like so:
> $sql = "INSERT INTO users(browsings) VALUES($url)";

Single quotes are necessary as $url is a string, so:

$sql = "INSERT INTO users(browsings) VALUES('$url')";

$sql is a string too, it has not been … Reply by cereal
Member Avatar
cereal 1,328 Replied To a Post in Where To Precede The Tracking Url ?
Topic by UI in Web Development
php
> Those sites you are viewing do not host your http://localhost:80/proxy/test.php? links nor precede it but your proxy itself does it.
> Now, as you can see the proxy is preceding "http://localhost:80/proxy/test.php?" in order to proxify your chosen url. But my idea is, instead of getting it to precede "http://localhost:80/proxy/test.php?", … Reply by cereal
Member Avatar
Topic by UI in Web Development
php
**@UI**

in addition to Andris, the first 16 lines are useless, because it makes a request to google and it does not use it. Line 21 (`$url`) is not used by the following code, so curl sends a request to the homepage not to the search. Even by changing that, … Reply by cereal
Member Avatar
cereal 1,328 Replied To a Post in Where To Precede The Tracking Url ?
Topic by UI in Web Development
php
Hi,

in practice you want to log the `$url` variable. Between line 202 and 246 the scripts initialize the variable, verifies if the url format is valid and finally it attemps to contact the server. Now you have to decide at which step you want to log, for example if … Reply by cereal
Member Avatar
cereal 1,328 Began Watching Where To Precede The Tracking Url ?
Howdy Pros!

If I was going to just track which urls from my own domain get clicked then I know how to do it.
On everyone of my links, I'll just add my tracking url, like so:

http://mydomain.com/?tracker.php

But like I said, I want to track what my users do … Topic by UI in Web Development
php
Member Avatar
Topic by UI in Web Development
php
Hi,

read the notice and the warning:

Notice: Use of undefined constant RETURNTRANSFER - assumed 'RETURNTRANSFER' in C:\xampp\htdocs\test\curl.php on line 27

Warning: curl_setopt() expects parameter 2 to be integer, string given in C:\xampp\htdocs\test\curl.php on line 27

The **notice** tells you that `RETURNTRANSFER` is not defined. The PHP engine in this … Reply by cereal
Member Avatar

Hi,

Does anyone have a clue why I get the following error in my further following code ?

Notice: Use of undefined constant RETURNTRANSFER - assumed 'RETURNTRANSFER' in C:\xampp\htdocs\test\curl.php on line 27

Warning: curl_setopt() expects parameter 2 to be integer, string given in C:\xampp\htdocs\test\curl.php on line 27

You are welcome … Topic by UI in Web Development
php
Member Avatar
Featured cereal 1,328 Began Watching Code Snippet Probability and Coin Tossing
Here's an interesting little scenario.

You get challenged to a game of coin toss. Both players pick a sequence of coin toss results (heads or tails). The coin is repeatedly tossed until the sequence for one of the players occurs. The loser pays the winner a dollar. You'd assume that … Topic by Reverend Jim in Programming
Member Avatar
Featured cereal 1,328 Gave Reputation to AssertNull in “Memo” btn proposal
Topic by jkon in DaniWeb Community Feedback
> jkon, essentially what you're asking for seems to me like a combination of reputation and post comments. For example, https://www.daniweb.com/members/479282/jkon/comments

...

> How is that different than what we have via our existing member comments page, which has the added bonus of tying into reputation and being able to … Reply by AssertNull
Member Avatar
cereal 1,328 Replied To a Post in Php function error
Topic by sophia_4 in Web Development
php
**@sophia_4**

You're welcome, I just realized you are usign CodeIgniter here, then you can use the **Encryption** library rather than the *Encrypt* library which is deprecated in the framework, see:

* https://codeigniter.com/userguide3/libraries/encryption.html

If the issue is solved, please press the solved button at the right side of the page, bye! … Reply by cereal
Member Avatar
cereal 1,328 Replied To a Post in Sinatra - Web Applications using Ruby
Topic by Mrewan79 in Web Development
Hi,

you have to define an HTML form, for some examples see:

* https://learnrubythehardway.org/book/ex51.html
* https://github.com/sinatra/sinatra/blob/master/examples/chat.rb Reply by cereal
Member Avatar
I understand how to generate objects from the database, using Sinatra with formatting, and I understand from tutorials how to use POST to send information back, but I don't understand how to use POST to transfer information from the browser (for instance from a text field, or inside <p id="stufftotransfer"><%= … Topic by Mrewan79 in Web Development
Member Avatar
Featured cereal 1,328 Gave Reputation to pty in Shortcuts to SSH
Topic by Dani in Mac OS X
ssh
Here's how I'd do it (and have done it for years). It's the canonical, accepted answer for Linux too.

The SSH program has support for 'shortcuts' built in, you simply need to add the hostnames (or aliases) in your `~/.ssh/config` file.

So, in *my* config file, if I have the … Reply by pty
Member Avatar
Topic by UI in Web Development
php
I have a bad feeling about this.

Robots, code forcing likes? Bad robot, sit, stay.

PS. Adding with edit. This is a bad idea in my opinion since it sounds like you seem to want to robotically create likes. If folk were able to do this than it's a useless … Reply by rproffitt
Member Avatar
Topic by sophia_4 in Web Development
php
Almost done. You need to set the TO header, in this case it can be the SMTP username or another email address of yours:

$mail->AddAddress($row['email']);

Line 17 will probably need to be set to TRUE:

$mail->SMTPAuth = true;

Otherwise it will not attempt to authenticate, you can set it to … Reply by cereal
Member Avatar
Featured cereal 1,328 Began Watching mounting android micro sd
I'm having trouble mounting my android's micro sd card. When I run lsusb I see the entry for the card

`lsusb` - > `Bus 001 Device 006: ID 0bda:0158 Realtek Semiconductor Corp. USB 2.0 multicard reader`

I have also validated that the device is sdf.



me@mothership ~ $ sudo mount … Topic by lewashby in Linux and Unix
Member Avatar
cereal 1,328 Replied To a Post in inner join multiple tables to get information
Topic by patk570 in Databases
Hi,

look at the WHERE clause, you have:

WHERE (qbcd_user_email.address = '.patrick.kershner@gmail.com.')

So is going to search an email address with a leading and trailing dot, due to:

WHERE (qbcd_user_email.address = '.$email.')

Since you are using double quotes to enclose the query, you don't need the concatenation operator `.`, just … Reply by cereal
Member Avatar



I am using OS Ticket and I have another site for Members Area,I
am trying to join the 3 tables that have the information that corresponds to the customer by EMAIL.

the first table is:qbcd_ticket:
ticket_id | number | user_id | user_email_id | status_id | dept_id | and more...
5 … Topic by patk570 in Databases
Member Avatar
cereal 1,328 Replied To a Post in Submit 2 forms with single submit button
Topic by phphp in Web Development
php
Hi,

you cannot do this with plain HTML. You need javascript: you could use AJAX to submit the two forms, but you are going to generate two separated requests, with two separated responses from the server(s). Which means the second could return before the first is completed. Or one could … Reply by cereal
Member Avatar
Sir I have these codes


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<style type="text/css">

.box{
margin:0 auto;
width:30%;
border:2px solid #CCC;
height:auto;
padding:10px;
margin-top:50px;
}

</style>
</head>
<?php
$my_continent="";
$my_country="";
$my_city="";
$my_zip="";

if(isset($_POST["submit"])){
$my_continent = $_POST['continent'];
$my_country = $_POST['country'];
$my_city = $_POST['city'];
$my_zip = $_POST['zip'];
} … Topic by phphp in Web Development
php
Member Avatar
Featured cereal 1,328 Replied To a Post in Shortcuts to SSH
Topic by Dani in Mac OS X
ssh
No, the password is not anymore involved. You could change the password for the daniweb@1.2.3.4 account and still be able to access without altering the key, because SSH is going to use another authentication method (via asymmetric cryptography). See:

* https://debian-administration.org/article/530/SSH_with_authentication_key_instead_of_password

For example: if you have 10 servers to connect, … Reply by cereal