Search found 434 matches

by hyper
Fri Sep 22, 2017 10:39 am
Forum: PHP coding => General
Topic: PHP HTML Mailing From Form
Replies: 1
Views: 18

Re: PHP HTML Mailing From Form

Turn on error reporting in php
by hyper
Sun Sep 17, 2017 6:45 am
Forum: PHP coding => General
Topic: Problem in inserting partial data from dropdown to mysql using PHP
Replies: 1
Views: 25

Re: Problem in inserting partial data from dropdown to mysql using PHP

You have a few problems: Your sql prepare and execute should be more like this : $stmt = $dbh->prepare("INSERT INTO REGISTRY (name, value) VALUES (:name, :value)"); $stmt->bindParam(':name', $name); $stmt->bindParam(':value', $value); // insert one row $name = 'one'; $value = 1; $stmt->execute(); al...
by hyper
Fri Sep 15, 2017 8:14 am
Forum: PHP coding => General
Topic: PHP - SQL Server Bulk Insert
Replies: 4
Views: 60

Re: PHP - SQL Server Bulk Insert

You're welcome :)

Using fgetscsv or something else would be a better solution than using a stored procedure in my opinion.

I suggested CALL since you had been using a stored procedure.

Is this to replace using ekzel, or to use with it? I'd be more inclined to only use one thing.
by hyper
Wed Sep 13, 2017 8:58 am
Forum: PHP coding => General
Topic: PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'on' for column
Replies: 6
Views: 74

Re: PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'on' for column

Sorry, I was using this for my choice of words: $err[] = "Wrong email format"; You have logic problems with your code, by this I mean your if statements, specifically at the lines already noted. ---------------------------------------------------------------------- Set and not-set variables: $this_i...
by hyper
Tue Sep 12, 2017 3:34 pm
Forum: PHP coding => General
Topic: PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'on' for column
Replies: 6
Views: 74

Re: PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'on' for column

You have logic errors: if (!filter_var($_POST['Email'],FILTER_VALIDATE_EMAIL)) { $err[] = "Wrong email format"; if (!$err) { $Name = htmlspecialchars($_POST['Name']); $County = htmlspecialchars($_POST['County']); $Degrees = htmlspecialchars($_POST['Degrees']); $Sector = htmlspecialchars($_POST['Sect...
by hyper
Tue Sep 12, 2017 11:48 am
Forum: PHP coding => General
Topic: PHP - SQL Server Bulk Insert
Replies: 4
Views: 60

Re: PHP - SQL Server Bulk Insert

Use CALL for stored procedures. This seems to be making life difficult for yourself though? in my mind having to continuously translate and save data from one form to another should only be done once (when upgrading) otherwise there will be newer and newer problems as you go. Luckily I've been windo...
by hyper
Tue Sep 12, 2017 11:18 am
Forum: mySQL & php coding
Topic: Getting a simple php script to display results
Replies: 14
Views: 192

Re: Getting a simple php script to display results

Look, very carefully at these lines (42 & 43):

Code: Select all

$result = mysqli_query($conn, 'SELECT * FROM TABLE 2');
if (!result)

When you use the </> button in the "Post a reply" box, the code is formatted like it is above.
by hyper
Mon Sep 11, 2017 10:11 am
Forum: PHP coding => General
Topic: Functions not working... probably simple reason?
Replies: 3
Views: 51

Re: Functions not working... probably simple reason?

You need to pass your database connection to your function and turn on error reporting while you are developing.
by hyper
Mon Sep 11, 2017 7:57 am
Forum: PHP coding => General
Topic: Functions not working... probably simple reason?
Replies: 3
Views: 51

Re: Functions not working... probably simple reason?

You need it pass the function your database as it isn't global.

This might a case for using Stored Procedures

Also turn on display errors while developing.
by hyper
Mon Sep 11, 2017 7:44 am
Forum: mySQL & php coding
Topic: Getting a simple php script to display results
Replies: 14
Views: 192

Re: Getting a simple php script to display results

As far as I understand mysqli Stands for mysqli improved MySQLi stands for MySQL improved (there is a difference, I'm not being pedantic). So it is best to use MySQLi it is not best to use MySQLi (although it is better than MySQL) Am i correct? No - you are not correct in my opinion for the reasons...
by hyper
Sun Sep 10, 2017 10:20 am
Forum: PHP coding => General
Topic: display data in input text and Option from my sql using php
Replies: 1
Views: 47

Re: display data in input text and Option from my sql using php

First thing to do is take your output html code and have a look at it for errors, if you can't see any problems, pass it through an html checker.
by hyper
Sun Sep 10, 2017 10:10 am
Forum: mySQL & php coding
Topic: Getting a simple php script to display results
Replies: 14
Views: 192

Re: Getting a simple php script to display results

And post your code in the reply box using the </> button, it makes it easier to read the code. /* Turn on error reporting */ ini_set('display_errors', 1); ini_set('display_startup_errors', 1); // Create connection $conn = new mysqli($servername, $username, $password); // Check connection if ($conn->...
by hyper
Sun Sep 10, 2017 10:07 am
Forum: mySQL & php coding
Topic: Getting a simple php script to display results
Replies: 14
Views: 192

Re: Getting a simple php script to display results

You're mixing mysqli and mysql statetements up
Call to undefined function mysql_num_rows()
It might be better to convert your code into PDO, it is better, easier and would lead to fewer types of these problems.
by hyper
Wed Sep 06, 2017 4:33 pm
Forum: mySQL & php coding
Topic: Many feilds and stored procedure.
Replies: 2
Views: 49

Re: Many feilds and stored procedure.

Where is your data coming from, and how is it stored / generated?
by hyper
Wed Sep 06, 2017 4:28 pm
Forum: mySQL & php coding
Topic: Getting a simple php script to display results
Replies: 14
Views: 192

Re: Getting a simple php script to display results

Do you get the
Connected successfully
message?
by hyper
Wed Aug 30, 2017 3:11 pm
Forum: PHP coding => General
Topic: How to flush console output line by line to webpage ?
Replies: 1
Views: 70

Re: How to flush console output line by line to webpage ?

Why would you want to output to a console before sending to a browser? Browsers might only accept the output from the buffer when the script is complete or when it reaches a certain size. Since the </body> and </html> will not be reached until the whole script is sent, sending line by line is probab...
by hyper
Tue Aug 29, 2017 8:11 am
Forum: PHP Scripts
Topic: unset memory error in wordpress
Replies: 1
Views: 82

Re: unset memory error in wordpress

Whilst it doesn't directly answer your question, it will more likely solve your problem: You'll need to examine all your code and see where you are loading things that you don't need, be ruthless in getting rid of unneeded arrays, classes, database calls and plugins used. If you are using an old PHP...
by hyper
Tue Aug 29, 2017 7:57 am
Forum: PHP General
Topic: Setting NetBeans environment for debugging PHP files outside of the htdocs subtree
Replies: 2
Views: 85

Re: Setting NetBeans environment for debugging PHP files outside of the htdocs subtree

The Netbeans web site should be your first stop, however, as I understand it; Netbeans uses your PHP installation for de-bugging.

Therefore your script needs to be in the correct directory root [htdocs].
by hyper
Sat Aug 26, 2017 7:37 am
Forum: PHP Scripts
Topic: Hopefully an Easy one -can't get PHP MySQL Script to pull any data
Replies: 1
Views: 88

Re: Hopefully an Easy one -can't get PHP MySQL Script to pull any data

I can't see any reason for the script to go back to normal output; can you try this and let us know what happens: <?php error_reporting(E_ALL); ini_set('display_errors', '1'); ?> <!DOCTYPE html> <html> <body> <?php $servername = "UCTestDB2.db.9484746.c3c.hostedresource.net"; $username = "UCTestDB2";...
by hyper
Fri Aug 25, 2017 10:00 am
Forum: PHP Scripts
Topic: Hopefully an Easy one -can't get PHP MySQL Script to pull any data
Replies: 1
Views: 88

Re: Hopefully an Easy one -can't get PHP MySQL Script to pull any data

The other post is probably an attempt to spam later or just get some posts? There is no need to publish your passwords, usernames, server-name or even database-name: it isn't of use to anyone helping; simply put: $servername = "***"; $username = "***"; $password = "***"; $dbname = "***"; When you sa...