jazzman1
Staff Alumni-
Posts
2,713 -
Joined
-
Last visited
-
Days Won
12
Everything posted by jazzman1
-
mysql_select_db extension should be set after mysql_connect(). mysql_connect("localhost","root","changeme"); mysql_select_db("certestdb"); $dbLink = mysql_connect("localhost", "root", "changeme"); You don't have to open more than one connection to database server and using mysql_error() function to debug your queries. All mysql_* extensions are deprecated as of PHP 5.5.0, and will be removed in the future, instead you should consider using PDO or MySQLi libraries.
-
You need to find some decent tutorial on the web how to upload a binary file to the file server using php/mysql/ajax.
-
Yes, you can, everything depends on your wishes. Google "ajax"
-
Yes, you need to separate them or just to redesign your current script using only one form tag.
-
You can have several forms in html document but they shouldn't be nested like in the example above.
-
Yes, I do! In that case "owner" is the identifier, its value it is a constant named "some_owner_name". So, in the cite you cited above we can allowable to quote identifiers within double quotes, like this: SELECT * FROM car WHERE "owner" = some_owner_name.
-
I'm agree with you by speaking of identifiers. But the issue we have here is about constants of char type.
-
Did you put error_reporting functions at the top of the uploader.php file?
-
@mac, why only by single-quotes? The values of string type just need to be quoted. I've never use double quotes to quote the value with char/varchar or date/time type but the following should be worked as well. $query = 'SELECT * FROM car WHERE owner = "'.$_POST['owner'].'"';
-
Then, post out the entire script of the uploader.php file and the content of this file containing the html uploading form.
-
Are you running into a white page or you're getting a message that the upload is not successful? You should consider turning on php error reporting which will give you(us) some indication of where or what the problem is. Put the following code on the top of the uploader.php file. ini_set('display_errors',1); error_reporting(E_ALL);
-
you are absolutely right my canadian friend
-
Amend, instead using(id) use using(member_id).
-
Why don't you use some aplication language function to achieve this? "Wordwrap" in php is a good option.
-
It could be much more effective using inner join. select sp.member_id, sum(sp.total) as Total, st.MinStage from student_points sp inner join (select id, member_id, min(stage) as MinStage from student_times where class = 'math' group by member_id) as st using (id) where sp.class = 'math' group by sp.member_id +-----------+-------+----------+ | member_id | Total | MinStage | +-----------+-------+----------+ | 4 | 111 | 23 | | 15 | 44 | 34 | | 21 | 22 | 5 | +-----------+-------+----------+ 3 rows in set (0.00 sec)
-
Yes, there is a better way to achieve this. You could consider using mysql date/time functions and a sql between operator.
-
Well, I am exhausted on what is wrong here. You could try to use a mysql_stmt_send_long_data() function to send a large data to MySQL server in pieces.
- 23 replies
-
Did you save the file after changes? # The MySQL server [wampmysqld] port = 3306 socket = /tmp/mysql.sock key_buffer = 16M max_allowed_packet = 1M To the database sever, change the value of max_allowed_packet = 1M to 100M, save the file and restart mysql server, then try to upload the video file directly via phpMyAdmin.
- 23 replies
-
Why don't you try what I suggested you above Find post_max_size = 8M and change the value to 200M. Find upload_max_filesize = 2M and change the value to 200M. Then, restart the server, wamp application or entire windows machine and try my testing code from reply #9. I don't have any idea where the mysql configuration file is, I'm not a windows user. Sorry for that, google it. PS, I found this , try next path -> c:\wamp\bin\mysql\mysqlx.y.z\my.ini
- 23 replies
-
Let me see the content of php.ini and my.cnf files.
- 23 replies
-
mysql event last executed time incorrect by 6 hours
jazzman1 replied to kathygriffin's topic in MySQL Help
Then it's easy If you want to run the MySQL server under different time zone of the computer (linux machine), you just need to find the mysql configuration file, named my.cnf ( under CentOS the path is /etc/my.cnf) and to add the default time zone. Since you're using a linux machine, you can use the usual international denotations for time zone and their abbreviations. So, open up the mysql config file and add the following inside [mysqld] section: default-time-zone = America/New_York You can also use coordinated Universal Time (UTC) like this: default-time-zone = -5:00 Restart MySQL. If you want run only the event schedule under different time zone, try next: DELIMITER // CREATE EVENT testdb ON SCHEDULE EVERY 1 MINUTE STARTS UTC_TIMESTAMP() - INTERVAL 5 HOUR DO BEGIN UPDATE `test`.`test` SET number = number + 1; END // DELIMITER -
mysql event last executed time incorrect by 6 hours
jazzman1 replied to kathygriffin's topic in MySQL Help
Since you have the EVENT privileges I'm guessing you have a super privilege on this mysql server or at least to this particular schema or am I wrong? What kind of privileges you have on this database server? -
Did you find where the mysql configuration file in wamp is? Add the following string to the [mysqld] section, restart the db server and try to upload the video data via phpMyAdmin. max_allowed_packet = 1024M // allow to upload a binary data file with size up to 1GB
- 23 replies
-
Here it's a test using my local db server. Create a table named binary_data: CREATE TABLE `binary_data` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `data` longblob NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; Next, try to insert the video file into data column with current filesize of 36MB. [lxc@localhost ~]$ du xss.mp4 36304 xss.mp4 // insert the binary file [lxc@localhost ~]$ echo "INSERT INTO binary_data VALUES (NULL,LOAD_FILE ('/home/lxc/xss.mp4'))" | /usr/bin/mysql test -h ::1 -u lxc -ppassword // select the LENGTH of the data [lxc@localhost ~]$ echo "SELECT CHARACTER_LENGTH(data) FROM binary_data" | /usr/bin/mysql test -h ::1 -u lxc -ppassword CHARACTER_LENGTH(data) 37174389 PS: The char_length sql command lists the file in Bites, the du command in kB.
- 23 replies