[Solved] mysql reporting syntax error

Put your query with quotes: $query = “INSERT INTO historial(`titulo_his`, `autor_his`, `editorial_his`, `isbn_his`, `color_his`, `fecha_inicio_his`, `fecha_final_his`, `idusuarios_his`, `codlibros_his`) VALUES(‘{$tit}’, ‘{$aut}’, ‘{$edit}’, ‘{$isbn}’, ‘{$color}’, ‘{$fechaP}’, ‘{$fecha}’, ‘{$_SESSION[‘idusuarios’]}’, ‘{$libro}’)”; The problem is that you are trying to insert strings without enclosing them into quotes, so the query will fail PS: And don’t use mysql_* functions the extension … Read more

[Solved] MySQL Query issue with select [closed]

Another approach to “join” two tables: SELECT proposal.proposalID, client.name FROM client, proposal WHERE proposal.clientID = client.id; Warning: I didn’t test this. In order to understand what’s going on, I suggest you learn more about SQL Joins. Some links to get you started: http://www.w3schools.com/sql/sql_join.asp http://en.wikipedia.org/wiki/Join_%28SQL%29 https://www.google.com/search?q=sql+join 2 solved MySQL Query issue with select [closed]

[Solved] Removing unwanted key/value pair in php array? [closed]

check this, use is is_numeric to check number or string. $data = array(“0″=>”1″,”id”=>”1″,”1″=>”mani”,”name”=>”mani”,”2″=>”ssss”,”lname”=>”ssss”); foreach ($data as $key => $val) { if(!is_numeric($key)) { $new_array[$key] = $val; } } print_r($new_array); OUTPUT : Array ( [id] => 1 [name] => mani [lname] => ssss ) DEMO 1 solved Removing unwanted key/value pair in php array? [closed]

[Solved] How to select row with same value

You could probably get by with something like this, assuming your table is called ratings: select r.* from ratings r inner join ( select name, rating, max(value) value from ratings group by name, rating having count(distinct sport) > 1 ) q on r.name = q.name and r.rating = q.rating and r.value = q.value There are … Read more

[Solved] how to select from this table and add average value and then sort [duplicate]

select * from <your query> order by PERC wich : select * from ( select no, STUD_ID,CLASS,LESSON, AVG(PERC) as PERC,SUM(CNT) as CNT from t_lesson where LESSON=’CHEM’ group by CLASS union all select no,STUD_ID,CLASS,’AVERAGE’ as LESSON, AVG(PERC) as PERC, SUM(CNT) as CNT from t_lesson where LESSON=’CHEM’ group by LESSON ) as sub order by PERC DESC … Read more

[Solved] Counting number of zeros in MySQL [closed]

I stripped the trailing and leading spaces from your text-formatted data and created an equivalent sample schema using SQL Fiddle. The setup looks like this: CREATE TABLE Grades (`htno` int, `sub` varchar(1), `marks` int, `credits` int) ; INSERT INTO Grades (`htno`, `sub`, `marks`, `credits`) VALUES (1, ‘a’, 15, 0), (1, ‘b’, 10, 0), (1, ‘c’, … Read more

[Solved] MySQL PHP Column Update Query

You haven’t provided any code or an attempt for us to go off of something so I’ll give you a brief way of doing it. Look up PDO here This is a really easy to follow and secure way to manipulate data in your database using php. Again as you haven’t given me much to … Read more

[Solved] mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/virtua15/public_html/main/1515/dafreg.php on line 9 [duplicate]

Something is wrong with query check with print mysql_error(); Check query. quote properly values assigned in query. $query = mysql_query(“SELECT jos_comprofiler.firstname, jos_comprofiler.lastname, jos_users.username, jos_comprofiler.cb_country, jos_users.email FROM jos_users LEFT JOIN jos_comprofiler ON jos_users.id=jos_comprofiler.id WHERE jos_users.id ='”.mysql_real_escape_string($id).”‘”); 2 solved mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/virtua15/public_html/main/1515/dafreg.php on line 9 [duplicate]

[Solved] how do you update a row in mysql with php from a user [closed]

I found two errors in your query additional , at the end of field list and missing ‘ in where condition. Update it to following: if (mysqli_query($db,”UPDATE division2 SET Pos=””.$pos.””, played ='”.$played.”‘, won ='”.$won.”‘, drawn ='”.$drawn.”‘, lost=””.$lost.””, goalsfor=””.$goalsfor.””, goalsag ='”.$goalsag.”‘, goalsdif=””.$goaldif.””, points=””.$points.”” WHERE team = ‘Treaty Celtic'”) === true) { 3 solved how do you … Read more