703 Topics

Member Avatar for
Member Avatar for thearts.beach

<?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 …

Member Avatar for thearts.beach
0
202
Member Avatar for PriteshP23

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 …

Member Avatar for PriteshP23
0
1K
Member Avatar for parantap

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 + "', '" + …

Member Avatar for pritaeas
0
151
Member Avatar for bops

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 …

Member Avatar for bops
0
311
Member Avatar for Moderns

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 …

Member Avatar for Zagga
0
250
Member Avatar for xxmp

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 …

Member Avatar for xxmp
0
306
Member Avatar for aspertrace

<?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 …

Member Avatar for aspertrace
0
214
Member Avatar for mpc123

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 …

Member Avatar for mpc123
0
212
Member Avatar for patk570

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 …

Member Avatar for diafol
0
345
Member Avatar for garyjohnson

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 …

Member Avatar for Atli
0
298
Member Avatar for khair.ullah

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, …

Member Avatar for diafol
0
323
Member Avatar for turpentyne

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 …

Member Avatar for pritaeas
0
166
Member Avatar for PF2G

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']."')")) …

Member Avatar for minitauros
0
152
Member Avatar for peterparker

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 …

Member Avatar for atia.akram
0
185
Member Avatar for ZER09

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 …

Member Avatar for ZER09
0
331
Member Avatar for GeekPlease

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 …

Member Avatar for GeekPlease
0
1K
Member Avatar for jacob21

Hi, I am executing below query. db.leads.find(); How to get execution time(in milli seconds) it take.

Member Avatar for pritaeas
0
133
Member Avatar for fheppell

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? …

Member Avatar for fheppell
0
161
Member Avatar for SLMQC

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 …

Member Avatar for G_Waddell
0
257
Member Avatar for de Source

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 …

Member Avatar for de Source
0
250
Member Avatar for akkbkht

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: …

Member Avatar for EvolutionFallen
0
210
Member Avatar for ak47carbon

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]

Member Avatar for ak47carbon
0
278
Member Avatar for batuzai04123

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. …

Member Avatar for batuzai04123
0
304
Member Avatar for dalilice

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 * …

Member Avatar for diafol
0
320
Member Avatar for cyberdaemon

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 …

Member Avatar for cyberdaemon
0
288
Member Avatar for VIPER5646

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 …

Member Avatar for VIPER5646
0
407
Member Avatar for mathieu89

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 …

Member Avatar for mathieu89
0
169
Member Avatar for while(!success)

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 …

Member Avatar for AleMonteiro
0
1K
Member Avatar for deepak.fugo

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 …

Member Avatar for AleMonteiro
0
187
Member Avatar for dbellerue

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 …

Member Avatar for QVeen72
0
603

The End.