jazzman1
Staff Alumni-
Posts
2,713 -
Joined
-
Last visited
-
Days Won
12
Everything posted by jazzman1
-
Do you know what's the difference between shared and dedicated server? PS: How much you pay per month and what's the name of your hosting company?
-
Are you on shared hosting?
-
PHP contact form not working for an app I'm writing.
jazzman1 replied to TimKukulka's topic in PHP Coding Help
I've never knew that Yahoo provides a web hiosting service, it's a something new to me. So, do a simple test for us. Open up Dreamweaver and connect to the yahoo server. Create a file named phpinfo.php inside this app directory (assuming it's a your web server working directory) and copy/paste the following simple php script: phpinfo.php <?php phpinfo(); Try to open this file up with your browser and tell us what result you're getting. jazz. -
if (isset($_POST['submit'])){ $user_ip=$_SERVER['REMOTE_ADDR']; $video_name=$_POST['video_name']; echo "<a href=http://youtube.com/watch?v=$video_name>Video Name</a>"; }
-
When the html form has been submited from the client (browser) to the application server, you should grab this value from the app server using some server side language like php for instance and which will send the value to database server. Then you should grab the value back from this database and write it down to application server which will pass the value to the client (browser). That's all you have to do
-
PHP contact form not working for an app I'm writing.
jazzman1 replied to TimKukulka's topic in PHP Coding Help
So just to clarify. You're using Dreamweaver as a default code editor on your apple machine and you want to send emails through out your personal Yahoo account, right? So, if it's true then you're able to make some changes into php config file because the server is located on your own machine and you're the owner. So my further questions are, have you ever started the web (apache) server service and do you have a copy of php version installed on this machine? -
PHP contact form not working for an app I'm writing.
jazzman1 replied to TimKukulka's topic in PHP Coding Help
Paste the following on top of the file which contains all php(server side) logic. I think, it's named submit.php ini_set('display_errors',1); ini_set('display_startup_errors',1); error_reporting(-1); PS: To be able to make some setting/editing in php config file named with crappy extension ".ini" you should have an admin(root) privilege to do this I'm not sure what environment are you using? -
PHP contact form not working for an app I'm writing.
jazzman1 replied to TimKukulka's topic in PHP Coding Help
I don't see any actual errors returned by PHP. Have you ever turned on the php checking error's reporting in the php.ini confing file? -
Left Join values from non-existing table to a real one
jazzman1 replied to jazzman1's topic in MySQL Help
Hm....this is my collation's status. mysql> SHOW VARIABLES LIKE 'collation%'; +----------------------+-------------------+ | Variable_name | Value | +----------------------+-------------------+ | collation_connection | utf8_general_ci | | collation_database | utf8_general_ci | | collation_server | latin1_swedish_ci | +----------------------+-------------------+ mysql> SHOW VARIABLES LIKE 'character%'; +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | latin1 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | +--------------------------+----------------------------+ mysql> SELECT character_set_name FROM information_schema.`COLUMNS` C WHERE table_schema = "test" AND table_name = "T1" AND column_name = "T1col"; +--------------------+ | character_set_name | +--------------------+ | utf8 | +--------------------+ This is the encoding of the linux terminal. [lxc@lxc1 ~]$ echo $LANG en_CA.UTF-8 If I try to run the query without CONVERT() I got an error. And YES, this is the right db sever, database and table name. I think this is just a bug but.... I'm still not sure exactly where on the application or db server? -
Left Join values from non-existing table to a real one
jazzman1 replied to jazzman1's topic in MySQL Help
More info: mysql> SELECT character_set_name FROM information_schema.`COLUMNS` C -> WHERE table_schema = "test" -> -> AND table_name = "T1" -> -> AND column_name = "T1col"; +--------------------+ | character_set_name | +--------------------+ | utf8 | +--------------------+ 1 row in set (0.01 sec) And....this, it's driving me crazy and don't still understand why should I have to convert something to latin collation if it's not exsit -
Left Join values from non-existing table to a real one
jazzman1 replied to jazzman1's topic in MySQL Help
This is the status of mine and godaddy DB server. As you can see the default connection is under utf8_general_ci. That's important thing I think. mysql> SHOW VARIABLES LIKE 'collation%'; +----------------------+-------------------+ | Variable_name | Value | +----------------------+-------------------+ | collation_connection | utf8_general_ci | | collation_database | latin1_swedish_ci | | collation_server | latin1_swedish_ci | +----------------------+-------------------+ 3 rows in set (0.00 sec) -
Left Join values from non-existing table to a real one
jazzman1 replied to jazzman1's topic in MySQL Help
Maybe, because this table is not really existing into a DB, mysql tries to use it as a default latin1_swedish_ci collation, but my linux terminals are on utf8 and failed to find itself a proper collation...or.. it's a just a bug on this db version. PS: I made a test to one of the godaddy database with version 5.0.96 using mysql workbench via SSH and works without any problems. -
Left Join values from non-existing table to a real one
jazzman1 replied to jazzman1's topic in MySQL Help
Yeap, this solved the issue. Thanks guys. -
Left Join values from non-existing table to a real one
jazzman1 replied to jazzman1's topic in MySQL Help
I got an error running the query through mysql command line instead mysql work bench: Everything is speaking in UTF-8 and the terminals of my linux machines(clients) too. I don't have any of latin1_swidish charset in my DB. Hey kick, I've got an empty result in mysql workbench, into mysql command line I got the above error of llegal mix of collations. -
Left Join values from non-existing table to a real one
jazzman1 replied to jazzman1's topic in MySQL Help
No problem Barry. Good night from Canada -
Left Join values from non-existing table to a real one
jazzman1 replied to jazzman1's topic in MySQL Help
mysql> select version(); +-----------+ | version() | +-----------+ | 5.5.35 | +-----------+ Let me try to restart it! No, same result. I changed mine varchar(45) to char(1) and the result is the same. -
Left Join values from non-existing table to a real one
jazzman1 replied to jazzman1's topic in MySQL Help
mysql> describe `test`.`T1`; +-------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+------------------+------+-----+---------+----------------+ | id | int(10) unsigned | NO | PRI | NULL | auto_increment | | T1col | varchar(45) | NO | | NULL | | +-------+------------------+------+-----+---------+----------------+ mysql> SELECT LENGTH(T1col) FROM T1 -> ; +---------------+ | LENGTH(T1col) | +---------------+ | 1 | | 1 | +---------------+ I have no idea. What's your db version? mysql> SELECT HEX(T1col) FROM T1; +------------+ | HEX(T1col) | +------------+ | 61 | | 63 | +------------+ 2 rows in set (0.00 sec) -
Left Join values from non-existing table to a real one
jazzman1 replied to jazzman1's topic in MySQL Help
My T1col is varchar(45). Do I need to change to char(1)? -
Left Join values from non-existing table to a real one
jazzman1 replied to jazzman1's topic in MySQL Help
No master. It's pretty much the same. -
Hi guys, what do I want to accomplish is to LEFT JOIN the values of list of strings against values of a real database table, named T1. mysql> SELECT id, T1col -> FROM `test`.`T1`; +----+-------+ | id | T1col | +----+-------+ | 1 | a | | 3 | c | +----+-------+ 2 rows in set (0.00 sec) So, if I try next comparing a string data, the query failed: SELECT tmp.string FROM ( SELECT 'a' AS string UNION ALL SELECT 'b' UNION ALL SELECT 'c' UNION ALL SELECT 'd' ) AS tmp LEFT JOIN T1 ON (T1.T1col = tmp.string) WHERE T1.T1col IS NULL No problems with numbers: Let's say, SELECT tmp.number FROM ( SELECT 1 AS number UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 ) AS tmp LEFT JOIN T1 ON (T1.id = tmp.number) WHERE T1.id IS NULL Result: +--------+ | number | +--------+ | 2 | | 4 | +--------+ So, what's wrong with strings here?
-
Sorry for the delay master. I was tired yesterday night My attempt was to find out a customer (who belongs to cust_ID) who ordered the most along with the total order quantity. I was thinking I would accomplish this with the query wrriten by you, but I see today you put a different logic on it. So, I've done mine with next query: SELECT o.cust_ID, o.order_name, o1.Total FROM test.Orders o INNER JOIN (SELECT cust_ID, order_name, sum(quantity) as Total FROM test.Orders GROUP BY cust_ID) as o1 USING (cust_ID) WHERE o1.Total = (SELECT MAX(Total) FROM (SELECT cust_ID, sum(quantity) as Total FROM test.Orders GROUP BY cust_ID) as o2) Result: +---------+------------+-------+ | cust_ID | order_name | Total | +---------+------------+-------+ | 2 | Books | 6 | | 2 | DVD | 6 | | 2 | phone | 6 | +---------+------------+-------+ The result is correct.
-
Hm...it's weird I have a "Orders" table very similar to yours, Barry. mysql> SELECT * FROM test.Orders; +----------+---------+------------+----------+------------+ | order_ID | cust_ID | order_name | quantity | order_sold | +----------+---------+------------+----------+------------+ | 1 | 1 | CD | 1 | 2014-01-20 | | 2 | 2 | Books | 1 | 2014-01-21 | | 3 | 2 | DVD | 2 | 2014-01-19 | | 4 | 1 | laptop | 4 | 2014-01-21 | | 5 | 3 | computer | 2 | 2014-01-16 | | 6 | 3 | CD | 3 | 2014-01-01 | | 7 | 2 | phone | 3 | 2014-01-12 | +----------+---------+------------+----------+------------+ When I run the following query I don't get the expected result. SELECT o.cust_ID, o.quantity, other.order_name as other FROM test.Orders o INNER JOIN (SELECT cust_ID, MAX(quantity) as max_q FROM test.Orders GROUP BY cust_ID) as o1 ON (o1.cust_ID=o.cust_ID AND o.quantity=o1.max_q) LEFT JOIN test.Orders other ON (o.cust_ID = other.cust_ID AND o.order_ID <> other.order_ID) ORDER BY o.quantity DESC, o.cust_ID Result: +---------+----------+----------+ | cust_ID | quantity | other | +---------+----------+----------+ | 1 | 4 | CD | | 2 | 3 | Books | | 2 | 3 | DVD | | 3 | 3 | computer | +---------+----------+----------+ 4 rows in set (0.00 sec) Does the column named "cust_ID", yours "idmember" the values inside should be in particular order? I did not play with yours.
-
php upload file not working inside a form
jazzman1 replied to mamaomphile's topic in PHP Coding Help
Any error messages? And describe the phrase, " it doesnt work", it's a very common phrase in the forum -
Can anyone suggest what Errcode: 2 or [mysqli.query]: (HY000/6) is ?
jazzman1 replied to jason310771's topic in MySQL Help
Do DESCRIBE to "places" table. Perhaps your PK is not auto_increment and there is a gap somewhere in the tables.