Jump to content

Paul-D

Members
  • Posts

    92
  • Joined

  • Last visited

Paul-D's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. Hi. I am trying to use FTP on my android phone as sending emails with videos has a size limit. I use FileZilla on my PC. When I when to the google store it pointed me add AndFTP. I have managed to download files but I am struggling to upload files from my DCIM folder. I can’t send large videos but I should be able to upload to my website MySQL. I can’t navigate with the upload setting. Also I would like to choose the download folder. Can anyone help here or suggest a better android FTP. I am still on the free version at the moment. Thanks. Desmond.
  2. The error is Warning: PDOStatement::execute() expects parameter 1 to be array, string given in /vhost/vhost15/d/e/s/desmond-otoole.co.uk/www/music2/musicX.php on line 37
  3. My server is still PHP4.5 as such I am using md5(). I know this should be changed. Md5() is still supported in PHP7 so I can address the issue then. I need to do 2 things return a set of records from a table preferably using prepare and execute. I need to return a record from an admin table to check at log in. I need the entire row including access levels and last time logged in. I am interested in this bindParam(1, $Name); as I think this could be useful. What I have using prepare and execute needs help with. So any corrections to this would be very helpful. <? $pdo = connectDB(); $Name = "Bruce"; $sql= ("SELECT * FROM PDO WHERE Name_F = ?"); // $Name goes here $stmt = $pdo->prepare($sql); // $stmt->bindParam(1, $Name); $stmt->execute($Name); while ($row = $stmt->fetch()) { echo $row['Name_F'] . " - " . $row['Name_S'] . " - " . $row['DOB'] . "<br>"; } echo "Music count = " . $stmt->rowCount(); ?>
  4. Hi. I have tried to use the prepare and execute on a sample table of people. This should returm to people with first name Bruce. Not sure what this bindParam is all about. Picked it up on an IBM PDO web site. <? $pdo = connectDB(); $Name = "Bruce"; $sql= ("SELECT * FROM PDO WHERE Name_F = ?"); // $Name goes here $stmt = $pdo->prepare($sql); // $stmt->bindParam(1, $Name); $stmt->execute($Name); while ($row = $stmt->fetch()) { echo $row['Name_F'] . " - " . $row['Name_S'] . " - " . $row['DOB'] . "<br>"; } echo "Music count = " . $stmt->rowCount(); ?>
  5. What is needed is function prototypes complete with explanations. Prepare() and Execute() ???
  6. The major problems with PDO there are no books on the subject just web pages with fragments of code. Back in the days of mySql there were and still are books you can buy.
  7. I used MD5 in my database. I use UserKey instead off a password as I can have more than 1 word. A sentance even using any cahrtecter $%^&£@! That is why I used md5. Passord is the same as userkey. I even tested the sql and got one record. My record is found as UserN = 'a39e9eea66930fe0050d56a28bafab72' and UserKey = '44f1fa64d8974c18bcb9182286d3e2aa' function LogMeX2($name,$pwd1) { $Name = md5($name); $Pwd1 = md5($pwd1); $sql = "SELECT User, UserKey FROM LIBusersX WHERE UserKey = '$Pwd1' AND UserN = '$Name'"; echo $sql; // Returns 1 record Name = 'a39e9eea66930fe0050d56a28bafab72' UserKey is the Password = '44f1fa64d8974c18bcb9182286d3e2aa' $pdo = connectDB(); $stmt = $pdo->prepare($sql); $stmt->execute([$Name]); // fetch/test if a row was found, i.e. the username was found if(!$row = $stmt->fetch()) { // username not found return false; } // username found, test password if(!password_verify($Pwd1,$row['UserKey'])) { // passwrod didn't match return false; } // username and password matched, return user id return $row['User']; }
  8. one if you is telling me to not use mdy when it is needed in the database. one of you is changing $conn to $pdo. another is chaging userkey to password. One did tell me to use $pdo = connectDB which does work. Another tells me to add $pdo to the function which dosn't work. Nobody want's to stick with the code I supplied in to you. You want to answere using your own variable names.
  9. okay ginerjm: solve this then. Nobody here can sort this out. The only way is the way I did it before. Each function makes it's own call. <html> <body> <? $Me = "James"; $Class = "French"; echo "My results are ". MySchoolResults($Me, $Class, $pdo); ?> </body> <html>
  10. ginerjm: Because I have writen in .NET. THe elephant in the room is that nobody here knows about web based programming. A web page can not supply a connection object. The page with all the functions needds to work this out itself. I was hopping that someonr here could supply a way to use a function without adding a $pdo to the function. Seems that I was wrong.
  11. Okay. I need a programmer who understands web based programming.
  12. Just in case I get another bloody nose. so I corrected it. I notice you want talk about the elephant in the room here which is web based Programming. In Microsoft .Net a web page dosn't supply the connection. <html> <body> <? $Me = "James"; $Class = "French"; echo "My results are ". MySchoolResults($Me, $Class, $pdo); ?> </body> <html>
  13. <html> <body> <? $Me = "James"; $Class = "French"; echo "My results are . " MySchoolResults($Me, $Class, $pdo); ?> </body> <html>
  14. I can not do this $x = MySchoolResults($user, $class, $pdo); The web page would complain. What is this unknown variable $pdo. <html><body>include functions.php $User="Me"; $Class="French"; <?$x = MySchoolResults($User, $Class, $pdo); ?> </body></html>
  15. I came here and got my head bitten off. The facts of life in any programming languages are, you CAN NOT call a function supplying 2 aguments when the called function requires 3 arguments. So $x = MySchoolResults($user, $class); function MySchoolResults($pdo, $user, $class) {} Sorry guys but that's a fact. Also web page programming is diffrent to desktop pc programms. Each web page is an individual who knows nothing about any other web page.
×
×
  • 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.