[Solved] Dynamic dropdown list

Easiest way of creating dynamic dropdown is by using jquery inside the head tag. Give onchange() event and guide the data to another page using jquery code, and then link 2 dropdowns. The code I did is like this, which I felt is the easiest way for dynamic dropdowns. jquery which I included is <script> … Read more

[Solved] adding php if condition in mysql query

Keep space between your concatenation, $ok = 1; $sql = “UPDATE users SET fn = :first, ln = :last”; if($ok == 1){ $sql .= “, phone = :phone “; } $sql .= ” WHERE users.id = :id”; 0 solved adding php if condition in mysql query

[Solved] How to Add last column in mysql table

Given the code you’ve posted, here’s how I’d handle this. First, I’d create an associative lookup array whose keys are the column names and whose values are the corresponding point values; it would look something like this: $pointVals = array(’email1′ => 2, ’email2′ => 5, ’email3′ => 2, … ); You can generate this array … Read more

[Solved] Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in [duplicate]

mysql_real_escape_string() needs an active connection to the MySQL server and will initiate one with the default data from the php.ini configuration if there is none. Do not use this function without first connecting to the database. Also, do not use the mysql_* functions. They are deprecated and will be removed from PHP. 2 solved Warning: … Read more

[Solved] get the total values of different user in mysql and php [closed]

SELECT MIN(a.ID) ID, a.name, SUM(b.Price) Price FROM table1 a INNER JOIN table2 b ON a.PID = b.PID GROUP BY a.Name SQLFiddle Demo OUTPUT ╔════╦══════╦═══════╗ ║ ID ║ NAME ║ PRICE ║ ╠════╬══════╬═══════╣ ║ 1 ║ ram ║ 4333 ║ ║ 2 ║ rani ║ 2000 ║ ╚════╩══════╩═══════╝ solved get the total values of different user … Read more

[Solved] Server data accessing from non local network without port forwarding

Yes, it’s possible to access the web server from an external network, depending on your current network configuration. There are two simple solutions I think would suit you. Configure your firewall if needed, enable port forwarding in your router settings to forward port 80 to the internal IP of the machine running your XAMPP-server. If … Read more

[Solved] mysql_fetch_array -> 2 mysql queries

You only need one function, run a join in your query SELECT customer_id, name FROM customer_ids INNER JOIN customers ON customer_ids.customer_identify = customers.identify This should get the required fields then jun run your loop normally 0 solved mysql_fetch_array -> 2 mysql queries