703 Topics
|
|
<?php $mysqli = mysqli_init(); $mysqli->real_connect("mysq.x.com","me","wordup","inthekitchin"); if ($mysqli->connect_errno) { echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error; } $res = $mysqli->query("UPDATE plate1 SET potatoes =('$_POST[potatoes]') WHERE id =('$_POST[id]')"); $row = $res->fetch_assoc(); ?> returnes error `Fatal error: Call to a member function fetch_assoc() on a non-object … |
|
I have 3 tables as mentioned below: Users Code Name NW London 1 Bill ---- ---- Contacts Code Country 1 USA Location Country City USA NW I need to update Users.NW = 1 in the Users Table. There are other cities like NW, London, Paris etc. In respective cities i … |
|
What is the error in the folloing code? I am not able to add data to the table cmd.CommandText = "insert into master (FirstName, middlename, lastname, [addressline 1], [addressline 2], city, pincode, state, country, Nationality, sex, DOB) values ('" + textBox1.Text + "', '" + textBox2.Text + "', '" + … |
|
Hi there, This question relates to data structures, performance and approach to a problem. It is best explained with example so bear with me. For the record, I will be using a combination of PHP, MySQL and Apache server on a dedicated Linux server. The problem is how we would … |
|
Hello, I need to know what's the best way to search tables with million records. I have a table called <people> and this table has the column: <status> Status might be more than one word like: "I am happy today and the weather is nice". Also, it might be in … |
|
Hello I have these database countries ->country_id ->country_name ->language counties ->county_id ->county_name ->language towns ->town_id ->town_name ->language locations ->location_id ->location_name ->language streets ->street_id ->street_name ->language and i have users that select country,county,town,location and optional street at a selected language and i want to show the show the informations of address … |
|
<?php $username = $_SESSION['username']; $result = 'sample'; $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } $sql = "Select FirstName from Person Where LoginID = (Select LoginID from UserLogin Where Username = '$username')"; $result = mysql_query($sql,$con); echo $result; ?> I'm kinda new to this server-side scripting … |
|
Hi I have an issue where by I have lots of products in a field which are comma delimited I want to replace those product words with a id number that I have in a different table. I currently use FIND INSET to replace a tab to the comma but … |
|
There is two sections i need it to update. When they hover over the members name listed below, I need it to show their details. When the user(one who submitted the content) posts its going to have a hidden value to update the field in the form that i have … |
|
Hello, I have a mysql query $query = "SELECT * FROM comments WHERE commenter_username IN (" . join(',', $list) . ") Or Number IN (" . join(',', $list) . ") ORDER BY comment_id DESC"; I want the query to select one row, the row with the highest id. Then store … |
|
Hi All, What Wrong with my QUERY ! it show Repetition of Record in INNER Join i.e when i have 3 record in database it show it 9 time using This query.... SELECT dbo.EmployeeSetup.EmpID, dbo.EmployeeSetup.EmpName, dbo.EmployeeSetup.FatherName, dbo.EmployeePayment.Designation, dbo.EmployeePayment.Department, dbo.EmployeePayment.Salary, dbo.EmployeePayment.Advance, dbo.EmployeePayment.Deduction, dbo.EmployeePayment.OvertimeAmount, dbo.EmployeePayment.PaymentDate, dbo.EmployeePayment.ModeOfPayment, dbo.EmployeePayment.NetPay, dbo.EmployeePayment.PayMonth, dbo.EmployeePayment.Fine, dbo.EmployeePayment.Fund, dbo.EmployeePayment.Insurence, dbo.EmployeePayment.Tax, … |
|
I'm going back to an old project to apply things I've learned. As a beginner, I was able to figure out how to change the query, based on what was chosen, but it seems like a backwards way to do it, and I'm not sure of a better way. I'm … |
|
Hi, i'm doing a website where the user can add his favourite bands in his profile. But not every band is in the DB, so if the band isn't in the DB it adds the name in the column. this is what i have: if(mysql_query("INSERT INTO bandas_fav(band_fav_id_user, band_fav_id_banda) VALUES('".$_GET['iduser']."', '".$bands_name['banda_id']."')")) … |
|
I am stuck on the final part of the query, I know that this thing is easy, but I am out of ideas now, so sorry for this. I have prepared a query like this: SELECT A.projectName as PARENT, (select COUNT(*) from PSPROJECTITEM WHERE PROJECTNAME = A.PROJECTNAME) parentprojecount, B.ProjectName as … |
|
I came up with this query now when i tried to create a view it failed to create SELECT aDate FROM ( SELECT @maxDate - INTERVAL (a.a+(10*b.a)+(100*c.a)+(1000*d.a)) DAY aDate FROM (SELECT 0 AS a UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 … |
|
Good day folks, I want to delete some records in my datatable using query. But I don't know how to do it. Can someone help me? Thanks For i As Integer = 0 To objChkArray.Count - 1 Dim rows As DataRow() = dtable.[Delete]("ct = '" & CInt(objChkArray(i)) & "'") For … |
|
This php code updates a database entry. The form consists of a checkbox (name = download) and a hidden field so I can check it has actually been sumbitted(name = updated). When I run this code it gives me the success message but the database remains unchanged. Why is this? … |
|
I am trying to create a form that allows the user to search (Access database) for a record by last name or customer number. It can be a partial last name or customer number. The SQL statement and code are below. This is the same method used successfully for a … |
|
hi i am new to sql i want to get some values from different tables and i have made my own logic like that "SELECT course_name, course_id FROM tbl_course WHERE course_id = (SELECT course_id FROM tbl_enrollment WHERE student_id = '" + lbl_StudentID.Text + "')" what could the correct sytax for … |
|
Hello. I am having a bit problem with the insert query, Every thing is fine but don't know why its not inserting the queries. Have a look onm code; function insert() { var table=document.getElementById("myTable1"); var table=document.getElementById("myTable"); <?php $con=mysqli_connect("localhost","root","","bsc_db"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: … |
|
i want to redirect my query base url to pretty url,i am trying this on local host, i want if any one try to access http://localhost/something/index.php?page=zen it will redirect to http://localhost/something/zen.html, ie http://localhost/something/index.php?page=zen => http://localhost/something/zen.html RewriteEngine On RewriteCond %{REQUEST_URI} ^/index\.php$ RewriteCond %{QUERY_STRING} ^page=([a-zA-Z0-9_-])$ RewriteRule ^(.*)$ http://localhost/cmsmadesimple/%1.html [L,R=301] |
|
Hi, I am currently working on joining 2 tables, however those tables have different number of columns thats why I have difficulty on joining them. I tried to use FULL OUTER JOIN, close result but still not my expected output. You can kindly see my attachment to see the scenario. … |
|
Hello, I'm tring to develop a mysql news scroller for my website. The problem that i'm facing is that i need to have multiple mysql querys joing together beceuase i have multple categories like: select * from news where category LIKE '$cat1' order by id desc limit 1 select * … |
|
Good day, I am having trouble with my condition, i dont know where should i put where in my query here is my code.. SELECT distinct MATERIAL ,Description ,Material_Type -- ,Requested_Delivery_Date ,ATP_check ,Delivering_Plant ,Order_Quantity ,Held_by_Finance ,Rejected_OOS ,Rejected_Others ,ISNULL(Open_Order_Quantity,0) AS Open_Order_Quantity ,ISNULL(Order_Quantity_NKA,0)as Order_Quantity_NKA ,ISNULL(Order_Quantity_RKA,0) AS Order_Quantity_RKA ,ISNULL(Order_Quantity_Others,0) AS Order_Quantity_Others ,ISNULL(Stock,0) AS … |
|
Hi all I have multiple checkboxes to be used as the status of a certain order. another words as the order is being processed the user will check the status and a date will be inserted into an access table. Now my isue is when a checkbox is checked for … |
|
Hi, I need to exclude any rows where the ASX_Prices.Date is a weekend. The date format is yyyy/mm/dd 2013/03/17. Ideally I would like to add another WHERE clause. WHERE ASX_Prices.Date !=weekend date????? $sql="SELECT Distinct ASX_Prices.ASX_Code, ASX_Prices.ASX_Price, ASX_Prices.Date, Company_Information.Company_Name FROM ASX_Prices, Company_Information WHERE ASX_Prices.ASX_Code = Company_Information.ASX_Code AND DateDiff(now(), ASX_Prices.Date)<=7 ORDER BY … |
|
Hi guys, I'm hoping you can help me find a more elegant solution to my query inside a foreach loop. Here is the loop in question: foreach (DataRow row in dt_blah.Rows) { SqlCommand sc = con.CreateCommand(); sc.CommandType = CommandType.Text; sc.CommandText = "select blah blah blah .. where S = @s1 … |
|
Hi All, I have 5 product tables(product_table_1,product_table_2 and so on), category table and sub category table I need to get number of products mapped for each category. i.e count of products accross categories. Below are the table structure and the query which i have written, I need to optimize the … |
|
I am developing a VB6 application which connects with an Access 2010 database. I want the application to execute queries stored in the database. Some of the queries include Access functions in field names. For example- FieldName: IIf(Nz([AnotherFieldName],0)=0,3,[AnotherFieldName])" Is there a way in VB6 to execute the queries natively in … |
The End.