So far, definitely delete[] m_KeyValuePairPtr.
For the individual elements, it depends on how the callee allocated elementPtr.
Since there's no way to be sure how the callee did it, either require the pointer to be allocated via new (then you use the third version to free the memory), or specify that the List does not own the memory for the pointers (then you would use the first version and require the user of the List to free the memory).
If you don't work with a run-time determined type, but the actual type is always exactly KeyValuePair (in C++11 you would declare that class as final to ensure this), and the type is copyable, then you also don't need an extra pointer and you can just copy it.
If you then also want to avoid default-construction and copy-assignment, but want it copy-initialized straight away you will need a POD-type for the array, use placement-new to initialize the field and manually deconstruct the elements:
[code]class KeyValueList
{
//...
char *m_KeyValuePairPtr;
};
KeyValueList::~KeyValueList()
{
for (int i = 0; i < m_Length; ++i)
{
GetArrayPtr()[i].~KeyValuePair();
}
delete[] m_KeyValuePairPtr;
}
KeyValuePair* KeyValueList::GetArrayPtr()
{
return reinterpret_cast<KeyValuePair*>(m_KeyValuePairPtr);
}
void KeyValueList::Insert(KeyValuePair *elementPtr)
{
if (m_Length == m_Capacity)
{
m_Capacity += 5;
char *actualArrayPtr = new char[sizeof(KeyValuePair) * 5];
KeyValuePair *arrayPtr = reinterpret_cast<KeyValuePair*>(actualArrayPtr);
for (int i = 0; i < m_Length; ++i)
{
new (&arrayPtr[i])(GetArrayPtr()[i]);
GetArrayPtr()[i].~KeyValuePair();
}
delete[] m_KeyValuePairPtr;
m_KeyValuePairPtr = actualArrayPtr;
}
new (&GetArrayPtr()[m_Length])(*elementPtr);
++m_Length;
}[/code]
If you use that code, you might also want to take the parameter by reference, instead of by pointer.
The disadvantage is that you need to copy each element when you allocate fresh memory for m_KeyValuePairPtr, instead of just being able to reuse the old memory.
But now all elements are next to each other, which increases cache coherence, so it's not a sole loss in performance.
I also think you want to allocate m_Capacity + 5 new elements, not just 5.
this should be really simple, I'm coding in Java just trying to make a toString() method of a Book object with a call number, title and author
This is what each of my get statements looks like, when I print out those variables in main using for example, "String a = b.getTitle();" which prints fine
This is what my get statements look like;
[code]
public String getAuthor(){
String a = author;
return a;
}
[/code]
The toString() method in question
[code]
public String toString(Book b){
String title, author, callNumber,outputString;
title=b.getTitle();
author=b.getAuthor();
callNumber=b.getCallNumber();
outputString = callNumber +" "+ title+" "+ author;
return outputString;
}
[/code]
The returned string outputs an address; i.e "librarysearch.Book@1a61c596"
I just want my string!
Your function expects a Book as parameter, you're (or some library-internal function is) probably calling toString().
Assuming this toString-function is a method of the class Book, you don't need the Book parameter and you can just access this.getTitle() and so on, for which you can also omit the "this."-part like you did in getAuthor() for the author-member variable.
HAHA derp, thanks, I haven't coded in so long.
[QUOTE=ZeekyHBomb;42273534][code]Queen queen = new Queen(workers);[/code]
This initializes a local variable "queen" which [i]shadows[/i] the class-scope variable "queen".[/QUOTE]
Removing that does nothing, though.
Removing that as in the whole line or just the 'Queen' in front of 'queen'?
I don't know my 3D math.
How would I rotate a camera around a point, for example.. a 3rd person camera.
[editline]25th September 2013[/editline]
To be more specific.. how do I calculate the sphere for the camera around the object, I know how to keep the camera rotated toward the object.
Assuming your camera is already on the sphere's surface (i.e. you just want to start circling the target point from your current coordinates).
You [i]could[/i] just move along the current tangent surface.
[code]// sphere_pos is the center of the sphere
// camera_pos is the position of the camera
// camera_up is the up direction of the camera
// move_x is longitudal movement distance, move_y is latitudal
vec3 delta = sphere_pos - camera_pos;
// "longitudal" direction
vec3 dx = vec3::norm(vec3::cross(delta, camera_up));
// "latitudal" direction
vec3 dy = vec3::norm(vec3::cross(dx, delta));
camera_pos += move_x * dx + move_y * dy;[/code]
The catch is that if move_x and move_y are not small, it'll quickly spiral outwards instead of truly circling.
So I decided to pick up programming again and started doing some tutorial from open.gl now after refractoring some code into oop I couldn't get my quad to draw anymore. I have been stuck on it for some time and I even removed some parts of my code so things like transformation don't even do anything anymore.
Could anyone take a quick glimpse at this : [url]https://dl.dropboxusercontent.com/u/28926055/OpenGL.rar[/url]
Yuk quincy18, you may want to put in a little more effort to make it easy on us. I mean try just giving us relevant code instead of your whole project tree with visual studio files littered everywhere.
Regardless I dug through and found you're not doing any kind of error checking. You should check glGetError() every now and then. It may help reveal certain problems. Otherwise I couldn't find anything wrong. You're doing lots of weird abstractions that made me confused (given my many post edits.), but everything seems like it would work ok. Sorry. :(
[code]GLenum glErr = glGetError();
if (glErr != GL_NO_ERROR ) {
printf( "ERR OpenGL error: %\n", gluErrorString( glErr ) );
}[/code]
[QUOTE=arleitiss;42237982]I just started regretting I didn't pay attention in maths in school, got basic problem here but I cannot solve it.
[IMG]http://i.imgur.com/8UBmksd.png[/IMG]
ArlBot is me, I need it to:
predict where the enemy is moving and shoot a bullet there.
What is available from enemy tank:
his speed (in pixels, usually 8)
his direction of movement (in degrees, in this case of image current direction is 90)
Distance to him from my tank (in pixels)
For me:
I can get my X and Y (doubt it's relevant here though)
I can turn my turret by degrees (relative to current position, so +/- value. - for left, + for right movement.
Basically from those available things I need to find a way to predict his spot roughly and shoot there so by the time bullet hits his Y axis, hes on that position with bullet.
Thanks.[/QUOTE]
To solve this is quite simple.
let;
a be the angle between the turret and the x-axis,
A be the position of the tank you're aiming at,
B be the position of your tank,
u be the velocity of the tank you're aiming at,
v be the SPEED of the bullet
I assume you're comfortable with vectors, if not, PM me.
You are looking to find BOTH an angle of projection (a) so that the bullet and the tank will be in the same position after (t) seconds.
You do this by solving simultaneously.
FIRST: Find an equation for the position of the tank.
Velocity, being defined as dx/st (change in position with respect to time) tells us that at some time
(t) the object will have moved (t) * [it's velocity]
This gives us an equation for the position of the tank (A) at time (t)
A(t) = A(0) + u * t
SECOND: Find an equation for the position of the bullet (B) at some time (t)
Alright, this one is slightly more complicated, firstly, as we do not know the velocity, only the speed
any equation will solve to not a point, but a circle. After (t) seconds, the bullet will have travelled
(v) * (t) meters, but we do not know in which direction, what shape is defined as all points
equidistant from a loci? A Circle!
We are trying to find the a possible intersection between the circle of possible positions of the
bullet, and the line in which the tank moves on. From this we can work out the angle the bullet was
shot at.
The equation for the bullets position is;
B(t) = B(0) + v * t * {cos(a), sin(a)}
two unknowns, hence a 2d solution.
Now, to find a possible collision point we need to make A(t) equal to B(t) (seems simple don't it)
This gives us the equation:
A(0) + u*t = B(0) + v * t * {cos(a), sin(a)}
By splitting the vectors into their x and y components we get two, simultaneous equations for (t) and (a), which is solvable.
Here is a picture demonstrating the concept.
[IMG_THUMB]https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-ash4/r270/1294547_681880808498101_286002183_o.jpg[/IMG_THUMB]
The (worked example's) two equations are:
[IMG]https://fbcdn-sphotos-f-a.akamaihd.net/hphotos-ak-ash3/574628_681880735164775_689847765_n.jpg[/IMG]
[editline]25th September 2013[/editline]
If the enemy tank is accelerating, PM me
[editline]25th September 2013[/editline]
I mean A(0) = {2,4} *oops*
Beautiful handwriting, Lemmingz
So, I'm just starting this C++ stuff and coming from Java, I'm not really sure on linking and all that.
Context: I'm trying to get a triangle to render in OpenGL (from [url]http://www.opengl-tutorial.org/beginners-tutorials/tutorial-2-the-first-triangle/[/url]). I'm using glfw and glew.
Problem: While I can run methods such as glewInit, I cannot do the same for glDrawArrays and similar glXXXXXX. My IDE recognizes these method names (changes their color), but I get undefined references when I try to build. undefined reference to `glClear@4', undefined reference to `glDrawArrays@12' in particular.
Thanks in advance
Make sure glew is initializing correctly. Sounds like it isn't. (it must be initialized after creating a ogl context.)
[QUOTE=ThePuska;42303371]Assuming your camera is already on the sphere's surface (i.e. you just want to start circling the target point from your current coordinates).
You [I]could[/I] just move along the current tangent surface.
[code]// sphere_pos is the center of the sphere
// camera_pos is the position of the camera
// camera_up is the up direction of the camera
// move_x is longitudal movement distance, move_y is latitudal
vec3 delta = sphere_pos - camera_pos;
// "longitudal" direction
vec3 dx = vec3::norm(vec3::cross(delta, camera_up));
// "latitudal" direction
vec3 dy = vec3::norm(vec3::cross(dx, delta));
camera_pos += move_x * dx + move_y * dy;[/code]
The catch is that if move_x and move_y are not small, it'll quickly spiral outwards instead of truly circling.[/QUOTE]
I added a distance check and interpolated it back to the starting distance but it is noticeable, is there a way of doing this without changing the distance between the two?
[QUOTE=Naelstrom;42306632]Yuk quincy18, you may want to put in a little more effort to make it easy on us. I mean try just giving us relevant code instead of your whole project tree with visual studio files littered everywhere.
Regardless I dug through and found you're not doing any kind of error checking. You should check glGetError() every now and then. It may help reveal certain problems. Otherwise I couldn't find anything wrong. You're doing lots of weird abstractions that made me confused (given my many post edits.), but everything seems like it would work ok. Sorry. :(
[code]GLenum glErr = glGetError();
if (glErr != GL_NO_ERROR ) {
printf( "ERR OpenGL error: %\n", gluErrorString( glErr ) );
}[/code][/QUOTE]\\
Sorry I already threw out a lot of shit and I thought it would be easier for people just to include the VS files. I tried to just include the core files of the abstraction and I couldn't narrow it down any further myself :(
I will try out the errorchecking in a few minutes after I finish some work so thanks for trying !
[editline]26th September 2013[/editline]
Some findings, it seems like I was trying to bind the vertexdeclaration to the program before linking and using the program. So it couldn't find the attribute location. It still didn't draw and I found out them_VAO GLint changed value's and that was fixed using this->m_VAO.
The problem is now it doesn't throw any error and it still doesn't draw grr. I tried removing some junk this time from the project while still including the VS project.
[url]https://dl.dropboxusercontent.com/u/28926055/OpenGL.rar[/url]
[code] $SQLstring = "insert into users (customernumber,name,phone,email,pw) values (DEFAULT, '".$_GET['name']."','".$_GET['phone']."','".$_GET['email']."','".$_GET['password2']."');";
$queryResult = @mysqli_query($DBConnect, $SQLstring)
Or die ("<p>Unable to insert data into the users table.</p>"."<p>Error code ". mysqli_errno($DBConnect). ": ".mysqli_error($DBConnect)). "</p>";
$IDString = "select customernumber from users where email == '".$_GET['email']."'";
$queryResult = @mysqli_query($DBConnect, $IDString);
echo "<p>Dear ".($_GET['name'])." you are successfully registered, and your customer number is ".$queryResult." which will be used to get into the system</p>";[/code]
I'm trying to make the customer number print in a string but no matter what I do, it won't work. The rest of the data (name/email/phone/password) is input through a form. It goes into the mysql database fine and I can print the name from the form okay, but the customer number is automatically generated therefore I need to do some form of query, but can't quite get it. (PHP)
I think the "==" in $IDString should be just "=".
Can you try manually entering the query into your database and then testing it for a correct outcome?
Edit:
Also, look into [url]http://php.net/manual/en/mysqli.insert-id.php[/url] , you could just use
[php]$lastInsertId = mysqli_insert_id($link);[/php]
With $link being the connection (the result from mysqli_connect).
[QUOTE=SammySung;42313942][code]$SQLstring = "insert into users (customernumber,name,phone,email,pw) values (DEFAULT, '" . mysqli_real_escape_string($DBConnect, $_GET['name']."','".$_GET['phone']."','".$_GET['email']."','".$_GET['password2']."');";[/code][/QUOTE]
Not sure if you're already sanitizing the user input elsewhere, but you can never let a raw user input go straight into the query. Google up 'SQL injection' if you want to know why.
Solution is simple - run the input through mysqli_real_escape_string($connection, $userInputString) or through $connection->real_escape_string($userInputString) - both are the same functions, there are just two ways to call them.
When constructing query strings the way you did, I usually get lost in all the quotes.
This is a much easier and better way (at least I do see like that) to generate query strings.
[code]
$SQLstring = sprintf("INSERT INTO users(customernumber, name, phone, email, pw) VALUES (DEFAULT, '%s', '%s', '%s', '%s')",
$DBConnect->real_escape_string($_GET["name"]),
$DBConnect->real_escape_string($_GET["phone"]),
$DBConnect->real_escape_string($_GET["email"]),
$DBConnect->real_escape_string($_GET["pw"])
);
[/code]
The last thing - unless you're doing it already out of the supplied code snippet, saving a user's password in a raw format is a terrible idea. Only store the password's hash (see the sha1($str) function).
[QUOTE=Naelstrom;42312637]Make sure glew is initializing correctly. Sounds like it isn't. (it must be initialized after creating a ogl context.)[/QUOTE]
I am, though I am also using glewExperimental.
[code]
// glfw Initialization
//glfw Window creation
glfwMakeContextCurrent(window);
glewExperimental = GL_TRUE;
GLenum err = glewInit();
if(err != GLEW_OK) {
cout << err << endl;
}
[/code]
This was the recommended way to use glew from [url]http://www.opengl.org/wiki/OpenGL_Loading_Library[/url]
You're linking to the OpenGL, GLEW, and GLFW libraries right?
[code]
g++ main.cpp -o main -lGL -lGLEW -lglfw
[/code]
My understanding was that -lglew already covered -lgl, and I shouldn't include -lgl since I've already got -lglew
[QUOTE=http://www.opengl.org/wiki/OpenGL_Loading_Library]
As with most other loaders, you should not include gl.h​, glext.h​, or any other gl related header file before glew.h​, otherwise you'll get an error message that you have included gl.h​ before glew.h​. [b]You shouldn't be including gl.h​ at all; glew.h​ replaces it.[/b][/QUOTE] (emphasis added)
[QUOTE=Pilgrim;42316439]My understanding was that -lglew already covered -lgl, and I shouldn't include -lgl since I've already got -lglew
(emphasis added)[/QUOTE]
When it comes to including libraries, ignore all that, and include everything that you need. Really. In the correct order of loading too. It'll save you tonnes of headaches.
[QUOTE=mastersrp;42316504]When it comes to including libraries, ignore all that, and include everything that you need. Really. In the correct order of loading too. It'll save you tonnes of headaches.[/QUOTE]
Linking to opengl32 seemed to do the trick, thanks for the help, Naelstrom too
So I started taking a programming class in college, and I have a small question that I feel is not thread-worthy. The professor is teaching us Java, but from what I hear, it isn't that great for game development which is what I want to get into. How screwed am I? Is Java similar enough to convert to another language later on?
Trying to get some shaders to work. Using SFML.NETn but all i'm getting is a black square. My testsprite is just the 2x2 cube from tetris (black and white)
So, i initialize my shader stuff on the C# end like this (don't mind the variable names, just test stuff):
[code]
Texture texture = new Texture("media/block.png");
Sprite _sprite = new Sprite(texture);
Shader shader = new Shader( "media/basic.vert", "media/basic.frag" );
shader.SetParameter( "texture", texture );
RenderStates states = new RenderStates( shader );
[/code]
and draw it using
[code]window.Draw( _sprite, states);[/code]
My shaders are these (from various sources around the internet)
vertex shader:
[code]varying vec2 vTexCoord;
void main()
{
vTexCoord = gl_MultiTexCoord0.xy;
gl_Position = ftransform();
}
[/code]
fragment shader:
[code]uniform sampler2D texture;
varying vec2 vTexCoord;
void main()
{
vec4 texColor = texture2D(texture, vTexCoord);
gl_FragColor = texColor;
}[/code]
But instead of getting the black/white tetris square, i just get a black square.
If i pass a color to gl_FragColor it does change to the correct color though. But still no texture.
Can anyone spot the problem?
Hi! I am following this tutorial for the Slick2D Engine:
(excuse me if I use the wrong terms or say the wrong things)
[url]http://thejavablog.wordpress.com/2008/06/08/using-slick-2d-to-write-a-game/[/url]
I changed the "complete" chink of code:
[code]import org.newdawn.slick.Animation;
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import org.newdawn.slick.Input;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.tiled.TiledMap;
/**
*
* @author panos
*/
public class WizardGame extends BasicGame
{
private TiledMap grassMap;
private Animation sprite, up, down, left, right;
private float x = 34f, y = 34f;
/** The collision map indicating which tiles block movement - generated based on tile properties */
private boolean[][] blocked;
private static final int SIZE = 34;
public WizardGame()
{
super("Wizard game");
}
public static void main(String [] arguments)
{
try
{
AppGameContainer app = new AppGameContainer(new WizardGame());
app.setDisplayMode(500, 400, false);
app.start();
}
catch (SlickException e)
{
e.printStackTrace();
}
}
@Override
public void init(GameContainer container) throws SlickException
{
Image [] movementUp = {new Image("data/wmg1_bk1.png"), new Image("data/wmg1_bk2.png")};
Image [] movementDown = {new Image("data/wmg1_fr1.png"), new Image("data/wmg1_fr2.png")};
Image [] movementLeft = {new Image("data/wmg1_lf1.png"), new Image("data/wmg1_lf2.png")};
Image [] movementRight = {new Image("data/wmg1_rt1.png"), new Image("data/wmg1_rt2.png")};
int [] duration = {300, 300}; grassMap = new TiledMap("data/grassmap.tmx");
/*
* false variable means do not auto update the animation.
* By setting it to false animation will update only when
* the user presses a key.
*/
up = new Animation(movementUp, duration, false);
down = new Animation(movementDown, duration, false);
left = new Animation(movementLeft, duration, false);
right = new Animation(movementRight, duration, false);
// Original orientation of the sprite. It will look right.
sprite = right;
// build a collision map based on tile properties in the TileD map
blocked = new boolean[grassMap.getWidth()][grassMap.getHeight()];
for (int xAxis=0;xAxis<grassMap.getWidth(); xAxis++)
{
for (int yAxis=0;yAxis<grassMap.getHeight(); yAxis++)
{
int tileID = grassMap.getTileId(xAxis, yAxis, 0);
String value = grassMap.getTileProperty(tileID, "blocked", "false");
if ("true".equals(value))
{
blocked[xAxis][yAxis] = true;
}
}
}
}
@Override
public void update(GameContainer container, int delta) throws SlickException
{
Input input = container.getInput();
if (input.isKeyDown(Input.KEY_UP))
{
sprite = up;
if (!isBlocked(x, y - delta * 0.1f))
{
sprite.update(delta);
// The lower the delta the slowest the sprite will animate.
y -= delta * 0.1f;
}
}
else if (input.isKeyDown(Input.KEY_DOWN))
{
sprite = down;
if (!isBlocked(x, y + SIZE + delta * 0.1f))
{
sprite.update(delta);
y += delta * 0.1f;
}
}
else if (input.isKeyDown(Input.KEY_LEFT))
{
sprite = left;
if (!isBlocked(x - delta * 0.1f, y))
{
sprite.update(delta);
x -= delta * 0.1f;
}
}
else if (input.isKeyDown(Input.KEY_RIGHT))
{
sprite = right;
if (!isBlocked(x + SIZE + delta * 0.1f, y))
{
sprite.update(delta);
x += delta * 0.1f;
}
}
}
public void render(GameContainer container, Graphics g) throws SlickException
{
grassMap.render(0, 0);
sprite.draw((int)x, (int)y);
}
private boolean isBlocked(float x, float y)
{
int xBlock = (int)x / SIZE;
int yBlock = (int)y / SIZE;
return blocked[xBlock][yBlock];
}
}
[/code]
so that the whole "map generation that also makes the Collision Detection array" goes into one class like this:
[code]
import org.newdawn.slick.tiled.TiledMap;
public class CompleteMap {
private TiledMap map;
private boolean[][] blocked;
public CompleteMap(TiledMap map)
{
this.map = map;
blocked = new boolean[this.map.getWidth()][this.map.getHeight()];
for(int xAxis = 0; xAxis < this.map.getWidth(); xAxis++)
{
for(int yAxis = 0; yAxis < this.map.getHeight(); yAxis++)
{
int tileID = this.map.getTileId(xAxis, yAxis, 0);
String value = this.map.getTileProperty(tileID, "blocked", "false");
if("true".equals(value))
{
blocked[xAxis][yAxis] = true;
}
}
}
}
public TiledMap getMap()
{
return this.map;
}
public boolean[][] getBlockedArray()
{
return blocked;
}
public boolean isBlocked(float x, float y)
{
int xBlock = (int)x / map.getTileWidth();
int yBlock = (int)y / map.getTileHeight();
return blocked[xBlock][yBlock];
}
}[/code]
Does this look like the correct way to do things? I'd like to look at code from someone elses Slick2D game to see how people do things and how they split up classes to eventually make the final game (cause I have NO clue) if anyone can lead me to some documentation on how to do that, it would be great. I remember there was some kind of MoJam where one of the devs made a game that ran on the Slick2D engine which has a french girl with baguettes and frogs and the like. I believe the dev released the source code for that, but I can't find it anywhere.
I guess what I'm asking is:
Is there any resources I can look at that will help me decide how to split up my classes?
Is there any "decent" source code I can look at that someone has released that has used the Slick2D engine as a base?
Thanks :)
[QUOTE=supersocko;42320024]So I started taking a programming class in college, and I have a small question that I feel is not thread-worthy. The professor is teaching us Java, but from what I hear, it isn't that great for game development which is what I want to get into. How screwed am I? Is Java similar enough to convert to another language later on?[/QUOTE]
Java is great for game development. And learning the basics of any programming language (besides brainfuck) will allow you to learn other languages with incredible ease. Feel free to look up game frameworks for java while you're in the class and make something you love.
-snippidy snip snip-
[QUOTE=SammySung;42313942][code] $SQLstring = "insert into users (customernumber,name,phone,email,pw) values (DEFAULT, '".$_GET['name']."','".$_GET['phone']."','".$_GET['email']."','".$_GET['password2']."');";
$queryResult = @mysqli_query($DBConnect, $SQLstring)
Or die ("<p>Unable to insert data into the users table.</p>"."<p>Error code ". mysqli_errno($DBConnect). ": ".mysqli_error($DBConnect)). "</p>";
$IDString = "select customernumber from users where email == '".$_GET['email']."'";
$queryResult = @mysqli_query($DBConnect, $IDString);
echo "<p>Dear ".($_GET['name'])." you are successfully registered, and your customer number is ".$queryResult." which will be used to get into the system</p>";[/code]
I'm trying to make the customer number print in a string but no matter what I do, it won't work. The rest of the data (name/email/phone/password) is input through a form. It goes into the mysql database fine and I can print the name from the form okay, but the customer number is automatically generated therefore I need to do some form of query, but can't quite get it. (PHP)[/QUOTE]
I've managed to make a bit of progress with this:
[code]$SQLstring = "insert into users (customernumber,name,phone,email,pw) values (DEFAULT, '".$_GET['name']."','".$_GET['phone']."','".$_GET['email']."','".$_GET['password2']."');";
$queryResult = @mysqli_query($DBConnect, $SQLstring)
Or die ("<p>Unable to insert data into the users table.</p>"."<p>Error code ". mysqli_errno($DBConnect). ": ".mysqli_error($DBConnect)). "</p>";
$Email = $_GET['email'];
$IDString = "select customernumber from users where email = '$Email'";
$queryResult = @mysqli_query($DBConnect, $IDString)
Or die ("<p>Unable to insert data into the users table.</p>"."<p>Error code ". mysqli_errno($DBConnect). ": ".mysqli_error($DBConnect)). "</p>";
echo "<p>Dear ".($_GET['name'])." you are successfully registered into ShipOnline, and your customer number is ".$queryResult." which will be used to get into the system</p>"; [/code]
But I'm getting this error : Catchable fatal error: Object of class mysqli_result could not be converted to string .. line 64. Last line is 64. Did a google, no idea how to fix it.
Sorry, you need to Log In to post a reply to this thread.