Two depth textures in fragment shader do not work

I want to use two depth textures (GL_DEPTH_COMPONENT32, FLOAT) in a fragment shader. The problem is both textures have the same content. If I set tex0 to GL_TEXTURE0 both textures look like tex0. If I set tex1 to GL_TEXTURE0 both look like tex0. Settings to GL_TEXTURE1 have no effect.
Here is my opengl code:

// bind first texture
GLuint tex_id =;
GLint tex_0_loc = glGetUniformLocation(the_shader_id, "tex0");
glUniform1f(tex_0_loc, 0);
glBindTexture(GL_TEXTURE_2D, tex_id);

// bind second texture
tex_id =;
GLint tex_1_loc = glGetUniformLocation(the_shader_id, "tex1");
glUniform1f(tex_1_loc, 1);
glBindTexture(GL_TEXTURE_2D, tex_id);


glBindTexture(GL_TEXTURE_2D, 0);
glBindTexture(GL_TEXTURE_2D, 0);


And here the fragment shader:

#version 430 core
precision mediump float;
in vec2 tex_coord;

uniform sampler2D tex0;
uniform sampler2D tex1;

out vec4 color;

void main()
    vec4 depth0 = texture(tex0, tex_coord);
    vec4 depth1 = texture(tex1, tex_coord);
    if(tex_coord.x>0.5) {
	color = depth0;
    else {
        color = depth1;

I cant see an error in my implementation. Why have both textures (tex0 and tex1) the same content? Is there something i forgot?
Thanks for any help.

Greets solarisx

You need to use glUniform1[b]i/b for texture unit IDs.

Thanks GClements very much! Now it works.

Greets solarisx