I would like to remove the borders here from an index.html :
<center><iframe src="echo.php"></iframe></center>
I want only the text: of this text.php
Echo "Hello work";
I would like to remove the borders here from an index.html :
<center><iframe src="echo.php"></iframe></center>
I want only the text: of this text.php
Echo "Hello work";
I am doing an execution from php like this:
$query1 = odbc_prepare($conn, "SELECT User FROM sqlsv2008r2.dbo.tabla WHERE email = ? ");
$result_1 = odbc_execute($query1, array($email));
if(odbc_num_rows($result_1)>0)
{
die("<center><h2><font color='red'>El Correo</font> <font color=#EEEA0B'>$email</font><font color='red'> NO esta Disponible</font></h2></center>");
}
I get this error:
Warning: odbc_execute() [function.odbc-execute]: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]The data types varchar(max) and text are incompatible in the equal to operator., SQL state 37000 in SQLExecute in C:\xampp\htdocs\gg\ar_.php on line 3
How can I solve that? I use SQL server 2008 r2
How do I subtract the remaining hours from an event:
Example at 3 PM, which would be 3:00 p.m. I have to go to the gym, I have the time I have to go in this format:
'2021-03-02 10:00:00'
How many hours do I have left if I currently have '2021-02-28 10:00:00' I have this Script but it doesn't work as I want:
DECLARE @tiemporeal int
SELECT TOP 1 [ActionTime] FROM [PS_GameLog].[dbo].[Gym])
SET @tiemporeal =(SELECT TOP 1 (1-(
DATEPART(SECOND, [ActionTime]) +
1 * DATEPART(MINUTE, [ActionTime]) +
3600 * DATEPART(HOUR, [ActionTime] )
)) AS Resta_1
--,
--(SUM(
--DATEDIFF(SECOND,0,cast(Duracion AS DATETIME))
--)))) AS Resta_2
FROM [PS_GameLog].[dbo].[Gym])
SELECT (CAST(DATEADD(SECOND, @tiemporeal, 0) AS TIME))as Restante
I want it in this format: '71:59:59' any ideas? How to get the format and the subtraction? It should be countdown but I don't get an example
'71:59:59'
'71:59:58'
'71:59:57'
'71:59:56'
So until you reach zero.
CREATE TEMPORARY TABLE temporal(
IP varchar(15) NULL
);
CREATE TEMPORARY TABLE temporal_2(
IP varchar(15) NULL
);
SELECT IF (NULL = (SELECT IP FROM temporal WHERE IP = '0' LIMIT 1),
(INSERT INTO temporal_2(IP) VALUES ('1')),(SELECT NULL LIMIT 1));
DROP TEMPORARY TABLE temporal;
DROP TEMPORARY TABLE temporal_2;
Error
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO temporal_2(IP) VALUES ('1')),(SELECT NULL LIMIT 1))' at line 2
I want to do this from SQL server but in MySQL. The equivalent of this:
CREATE TABLE #Temp (IP varchar(15))
INSERT #Temp (IP)VALUES (0)
IF NOT EXISTS (SELECT IP FROM #Temp WHERE IP = 0)
BEGIN
PRINT 'Entro'
END
DROP TABLE #Temp
How can I get only the time in advance 8 hours for example it is 12 PM and an event will happen at 20 Hours Server.
If I do this I will get 8 days but I need to do the same but in Hours .
SELECT GETDATE()+8
I have the following Script.
USE [PS_GameData]
GO
/****** Object: Table [dbo].[Guilds] Script Date: 07/24/2018 17:33:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Guilds](
[RowID] [int] IDENTITY(1,1) NOT NULL,
[GuildID] [int] NOT NULL,
[GuildName] [varchar](30) NOT NULL,
[MasterUserID] [varchar](12) NOT NULL,
[MasterCharID] [int] NOT NULL,
[MasterName] [varchar](30) NOT NULL,
[Country] [tinyint] NOT NULL,
[TotalCount] [smallint] NOT NULL,
[GuildPoint] [int] NOT NULL,
[Del] [tinyint] NOT NULL,
[CreateDate] [datetime] NOT NULL,
[DeleteDate] [datetime] NULL,
CONSTRAINT [PK_Guilds] PRIMARY KEY CLUSTERED
(
[GuildID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[Guilds] ADD CONSTRAINT [DF_Guilds_Del] DEFAULT (0) FOR [Del]
GO
I want to Execute it but when trying to Create the table it gives me an error:
Msg 2714, Level 16, State 5, Line 2
There is already an object named 'PK_Guilds' in the database.
Msg 1750, Level 16, State 0, Line 2
Could not create constraint. See previous errors.
Msg 4902, Level 16, State 1, Line 2
Cannot find the object "dbo.Guilds" because it does not exist or you do not `have permissions.`
I think I should delete the PK_Guilds but I don't know where or how I get it in the SQL server 2008 R2 DB
I have the following:
CREATE Table apellidos_completo (Completo varchar (255))
INSERT INTO apellidos_completo (Completo )values ('alvarez')
UPDATE apellidos_completo set Completo = 'Rodriguez' + Completo
I do SELECT
SELECT *
FROM apellidos_completo
the result should be
'Rodriguez Alvarez'
However, the result obtained is:
(0) osea CERO
NOTE: if I do it in SQL server it works for me, Good but in MySQL it doesn't work.
I have advanced this Script but I don't know why it doesn't work for me I can't locate the error if someone can help me?
@echo off
mysqldump -h localhost -u root -p Dotado256 sixstar_almacen > AlmacenBeta _ 19082018.sql
Pause
I use Xammp the database is (sixstar_almacen) Obviously without parentheses, what I want is that when I click this Bat I do the .SQL on my PC but it doesn't work
I have tried the following SELECT
:
SELECT (2*3) as Resultado
i got this
Resultado
6
I need this result:
Resultado
06
If I multiply like this:
SELECT (12*2)
Resultado
24
I want the result to only contain two digits always, how do I do that?
I need to generate a random number between 1 and 99 but without decimals. Try one select
like the following:
SELECT RAMD () 1 AND 99
But the same gives me an error search in Google and I did not understand.
I have the following query for mysql but when doing it it gives me an error.
ALTER TABLE conexion ADD
panel_web varchar (255),
panel_web1 varchar (255),
panel_web2 varchar (255),
puerto_panel varchar (255);
The question is how do I add multiple columns using the same query? (that same one works fine for me in SQL server 2008 r2 but in mySQL it doesn't work)
I appreciate the support.
I tried this other one that they told me here but it does not work, it gives me an error
ALTER TABLE conexion ADD
panel_web varchar (255) AFTER
panel_web1 varchar (255)AFTER
panel_web2 varchar (255) AFTER
puerto_panel varchar (255);
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar (255)AFTER panel_web2 varchar (255) AFTER
I have the following query, but I'm afraid that INTO
it doesn't create temporary tables in MySQL , which in SQL server 2008 R2 it does without problems. I need to update a table from the data obtained from sr_itemRock
so that it is updated in sr_productos
. The detail that does not come out is the creation of temporary tables.
Query:
SELECT a.ItemID, a.ItemDesc
INTO #Temp
from sr_itemrock a
INNER JOIN sr_productos b
on a.ItemID = b.codigo
WHERE id > 600
UPDATE sr_productos
SET
descripcion_bra IN (SELECT ItemDesc FROM #Temp)
,descripcion_eng IN (SELECT ItemDesc FROM #Temp)
,descripcion_esp IN (SELECT ItemDesc FROM #Temp)
WHERE
ItemID IN (SELECT ItemID FROM #Temp)
DROP Table #Temp
This query normally in SQL Server does not have errors, but in MySQL it does. The detail is in the temporary tables. Can anyone give me any idea how to update data from one table to another using temporary tables?
Mistake:
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from sr_itemrock a INNER JOIN sr_productos b on a.ItemID = b.codigo WHERE id ' at line 3
Hi, I know that SQL Server
something query
like this is done to take the LAST record NOT THE FIRST
SELECT TOP 1 *
FROM Tabla
ORDER by ID DESC
So it takes me the last record of the MSSQL table, that is SQL server 2008 R2 but in MySQL
place this and it takes me the first record. What should I do or what am I doing wrong? Read the beginning since they downvoted me after doing a little more research
SELECT *
FROM Tabla
ORDER by ID DESC
LIMIT 1
MAKING IT CLEAR that I just understood this, and I understood it after making this Post, that the equivalent of a
TOP 1
of SQL server is
MIN(exprecion)
and the last record is
MAX(exprecion)
Of course it is with your condition.
How can I get dates without hours or minutes in a SQL query to use a COUNT
? I need you to show me the repeated amount and the day it was made. Any suggestion? Be careful, it's not MySQL I need, it's for SQL server 2008 R2
SELECT TOP 2000
a.UserID,
(a.CharName) as maton,
(a.DeadCharName) as Victima,
(b.[level])as nivel_de_Victima,
COUNT (a.DeadCharName) As Veces,
a.actiontime <<---- Campo Fecha a selecionar
FROM PS_GameLog.dbo.Kill_Log a
INNER JOIN PS_GameData.dbo.Chars b
on a.CharID = b.CharID
WHERE a.CharID = 62336
ORDER BY Veces DESC
GROUP BY a.UserID,a.CharName,a.DeadCharName,b.[level]
ORDER BY Veces DESC
Example, of what format dates are in, I need to take the obvious 11 digits including hyphens.
2016-12-23 15:42:29.000
2016-12-23 15:42:28.000
2016-12-23 15:42:30.000
I want to add more than 255 images in a dropdown menu, I did this but it does not show the image, if someone helps me I appreciate it.
<table>
<tr>
<td>Modificar Porcentaje de dificultad:</td>
<td>
<select name="percent">
<option value="100">
<a class="back" href="images/anillo.png"></a>
</option>
<option value="100">
<a class="back" href="images/utileria.png"></a>
</option>
<option value="100">
<a class="back" href="images/joyeria.jpg"></a>
</option>
</td>
</tr>
</table>
I use SQL server 2008 R2
I want to make a simple one select
that GETDATE()
shows a specific date format without a year:
day month
This select
gives me the values but in separate columns
SELECT MONTH(GETDATE()), Day(GetDate())
I need to do it but in this example format: day 1 month december
Date
12/1
i tried this:
SELECT (MONTH(GETDATE())/ Day(GetDate())) as Fecha
the result is :
Date
0
In a table called pacientes
I have a Juan
, which is varchar (4)
.
My if
has the following drawback Juan
can be Pedro
or José
. In other words, this name can vary an infinite number of times. I need one IF
that enters Begin
if it Select
shows a result.
The following IF
shows I think only alpha-numeric in>0
I want that if it select
shows 'X' of result enter in Begin
, what I had will be something like this
IF (SELECT Nombre FROM Tabla WHERE CEDULA)>0
BEGIN
PRINT 'Entro'
END
ELSE
PRNT 'NO ENTRO'
Understand that for me I think that >0
"Greater than 0" means Show number of Rows Shown or am I wrong? or shows if the number of select
is greater then it enters?
How would it be spelled correctly?
I made this #Temp (Temporary Table) to see how it goes but it didn't work for me.
CREATE TAble #Temp
(
NOMBRE varchar (250)
)
INSERT #Temp Values ('Juan');
IF (SELECT Nombre FROM #temp)>0
BEGIN
PRINT 'EXITO'
END
ELSE
PRINT 'NO EXISTE'
Very important the word juan
are combinations of the AZ that is thousands of combinations
I mean I want a solution to the line
IF (SELECT Nombre FROM #temp)>0
I took this as a varchar and not as an int
Search in Google and I did not find an answer for this, it seems easier to ask here.
UPDATE table
SET Paciente = Juan Perez
WHERE RowID IN NOT (1,2.3)
My problem is that I want to add a date column in this format 2016-08-13 exactly in this Order I achieve it with this:
DATE_FORMAT(NOW(),'%y-%m-%d')
but now I need the same format but adding 30 days something like that but I have no idea
DATE_FORMAT(NOW(),'%y-%m-%d')+30
The detail is that when I make the symbol +30 I get this 0000-00-00, how can I solve it?
In the following php query but it does not allow me to remove this [GS] that is between square brackets inside the table as a record (NOTE: Below I leave a small SQL Capture Photo of my question, I appreciate answers. I think the image explains better.)
$result3 = mssql_query(' UPDATE Ps_GameData.dbo.Chars
SET CharName = replace (CharName,\'' **[GS]** '\' ,'' ) ');
The error I get is the following:
Parse error: syntax error, unexpected [ in line 60
I want it to remove " [GS] " and leave the name empty.
Example:
The SQL query:
UPDATE PS_GameData.dbo.Chars SET CharName = replace (CharName, '**[GS]**' ,'')
You get this result:
[GS]Juan
In this case, I want to make "John" just without the content inside the bracket.
The SQL query works fine but I need to adapt this functionality using php.
Example:
$result3 = mssql_query(' UPDATE Ps_GameData.dbo.Chars
SET CharName = \'**[**\'+\'**GS**\'+\'**]**\' + CharName ');
It works excellent, but now I want to remove it and I can't find the way I know that replace is used but I can't place the character configuration so that the bracket is part of the SQL php query
I want to remove the [ character before GS as such synthesis would be:
$result3 = mssql_query("UPDATE Ps_GameData.dbo.Chars
SET CharName = replace (CharName,'\'[ '\','')